Newer
Older
zweic / tests / 4 / term-objComp.zwei
@ajaggi ajaggi on 26 Dec 2005 561 bytes Added some test cases
  1. // ObjComp
  2.  
  3. class foo {
  4. Int y;
  5. }
  6.  
  7. class bar {
  8. Int h;
  9. }
  10.  
  11. class bof extends bar {}
  12.  
  13. class ObjCompTest {
  14. Null foo() {
  15. bar b = new bar(1);
  16. bof z = new bof(1);
  17. foo f = new foo(2);
  18. f + b; // 1/5 failure of clause 1 (binop not == or !=)
  19. k == b; // 2/5 failure of clause 2 (nonexistent ident)
  20. b == l; // 3/5 failure of clause 2 (nonexistent ident)
  21. f == b; // 4/5 failure of clause 3 (subtype mismatch)
  22. b == f; // 5/5 failure of clause 3 (subtype mismatch)
  23. z == b; // success
  24. }
  25. }
  26.  
  27. 1