Newer
Older
zweic / tests / 4 / statement-var.zwei
@ajaggi ajaggi on 26 Dec 2005 472 bytes Added some test cases
  1. // Var
  2. class foo {}
  3. class bar extends foo {}
  4. class baz {}
  5. class VarTest {
  6. Null foo() {
  7. Int n = 1;
  8. nonexistent ne = new nonexistent(); // 1/4 failure of clause 1 (nonexistent type)
  9. baz b = new foo(); // 2/4 failure of clause 2 (subtype mismatch)
  10. bar f = new foo(); // 3/4 failure of clause 2 (inverted sub- and supertypes)
  11. Int n = 2; // 4/4 failure of clause 3 (variable n already exists)
  12. Int z = 3; // success
  13. }
  14. }
  15.  
  16. 1