Newer
Older
zweic / tests / 4 / term-new.zwei
@ajaggi ajaggi on 26 Dec 2005 462 bytes Added some test cases
// New

class foo {
    Int y;
}

class bar {
    Int h;
}

class bof extends bar {}

class testnew {
    Int x;
    Null foo() {
        bof bof = new bof(3);
        new unknown(); // 1/3 failure of clause 1 (nonexistent class)
        bar b = new bar(); // 2/3 failure of clauses 2 and 3 (wrong number of arguments)
        bar c = new bar(bof); // 3/3 failure of clauses 2 and 3 (argument not subtype of Int)
        foo f = new foo(1); // success
    }
}

1