diff --git a/tests/4/aj-01.zwei b/tests/4/aj-01.zwei new file mode 100755 index 0000000..c97d76f --- /dev/null +++ b/tests/4/aj-01.zwei @@ -0,0 +1,11 @@ +class C { + Int a; + Int b; +} +{ + Int a = null; + C b = new C(a*10, 10); + + if ( a == b.a ) { + }; +} diff --git a/tests/4/aj-02.zwei b/tests/4/aj-02.zwei new file mode 100755 index 0000000..028917e --- /dev/null +++ b/tests/4/aj-02.zwei @@ -0,0 +1,24 @@ +class List { + Int isEmpty() { return this.isEmpty() } + Int head() { return this.head() } + List tail() { return this.tail() } + List cons(Int x) { return this.cons(x) } +} + +class Cons extends List { + Int head; + List tail; + Int isEmpty() { return false } + Int head() { return this.head } + List tail() { return this.tail } + List cons(Int x) { return new Cons(x, this) } +} + +class Nil extends List { + Int isEmpty() { return true } + List cons(Int x) { return new Cons(x, this) } +} + +{ + if ( "aaa" == "" ) {}; +} diff --git a/tests/4/aj-03.zwei b/tests/4/aj-03.zwei new file mode 100755 index 0000000..ce5a6f7 --- /dev/null +++ b/tests/4/aj-03.zwei @@ -0,0 +1,10 @@ +class A { } +{ + A a = new A(); + if ( 0 ) 10 + else 20 + ; + if ( 0 ) 10 + else a + ; +} diff --git a/tests/4/aj-04.zwei b/tests/4/aj-04.zwei new file mode 100755 index 0000000..9e3dc19 --- /dev/null +++ b/tests/4/aj-04.zwei @@ -0,0 +1,6 @@ +class A { + Int a; +} +{ + A a = new A(); +} diff --git a/tests/4/michitest-001.zwei b/tests/4/michitest-001.zwei new file mode 100755 index 0000000..1ab5939 --- /dev/null +++ b/tests/4/michitest-001.zwei @@ -0,0 +1,18 @@ +class A { + Int x; +} + +class B { + Int x; + Int equal(B that) { + return this.x == that.x + } +} + +class C extends B{ +} + +{ + printInt(new B(1).equal(new C(2))); + printChar(10); +}