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

1