instanceof test
svn: r1317
This commit is contained in:
parent
d79eea8f37
commit
e27d64ed8d
|
@ -174,7 +174,7 @@
|
||||||
}"
|
}"
|
||||||
'intermediate #f "Book Test Date")
|
'intermediate #f "Book Test Date")
|
||||||
|
|
||||||
(execute-test
|
(execute-test
|
||||||
"abstract class AZooAnimal{
|
"abstract class AZooAnimal{
|
||||||
String name;
|
String name;
|
||||||
int weight;
|
int weight;
|
||||||
|
@ -222,7 +222,7 @@
|
||||||
}"
|
}"
|
||||||
'intermediate #f "Calling super")
|
'intermediate #f "Calling super")
|
||||||
|
|
||||||
(execute-test
|
(execute-test
|
||||||
"interface foo {
|
"interface foo {
|
||||||
int size();
|
int size();
|
||||||
}
|
}
|
||||||
|
@ -231,7 +231,7 @@
|
||||||
}"
|
}"
|
||||||
'intermediate #f "Interface implemented")
|
'intermediate #f "Interface implemented")
|
||||||
|
|
||||||
(execute-test
|
(execute-test
|
||||||
"abstract class Path { abstract boolean isOk(); }
|
"abstract class Path { abstract boolean isOk(); }
|
||||||
abstract class Success extends Path {
|
abstract class Success extends Path {
|
||||||
boolean isOk() { return true; }
|
boolean isOk() { return true; }
|
||||||
|
@ -242,6 +242,14 @@
|
||||||
}"
|
}"
|
||||||
'intermediate #f "Abstract method implemented, class subclassed")
|
'intermediate #f "Abstract method implemented, class subclassed")
|
||||||
|
|
||||||
|
(execute-test
|
||||||
|
"class X {
|
||||||
|
boolean equals( Object o ) {
|
||||||
|
return o instanceof X;
|
||||||
|
}
|
||||||
|
}"
|
||||||
|
'intermediate #f "Correct instanceof usage")
|
||||||
|
|
||||||
;;Execute tests with errors
|
;;Execute tests with errors
|
||||||
|
|
||||||
(execute-test
|
(execute-test
|
||||||
|
|
Loading…
Reference in New Issue
Block a user