group codegen test files into directories per test case
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
class Base() {
|
||||
fun n(n : Int) : Int = n + 1
|
||||
}
|
||||
|
||||
class Abstract {}
|
||||
|
||||
class Derived1() : Base(), Abstract {}
|
||||
class Derived2() : Abstract, Base() {}
|
||||
|
||||
fun test(s : Base) : Boolean = s.n(238) == 239
|
||||
|
||||
fun box() : String {
|
||||
if (!test(new Base())) return "Fail #1"
|
||||
if (!test(new Derived1())) return "Fail #2"
|
||||
if (!test(new Derived2())) return "Fail #3"
|
||||
return "OK"
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
class X(val x : Int) {}
|
||||
class Y(val y : Int) {}
|
||||
|
||||
class Point(x : Int, y : Int) : X(x) , Y(y) {}
|
||||
|
||||
class Abstract {}
|
||||
|
||||
class P1(x : Int, yy : Y) : Abstract, X(x), Y by yy {}
|
||||
class P2(x : Int, yy : Y) : X(x), Abstract, Y by yy {}
|
||||
class P3(x : Int, yy : Y) : X(x), Y by yy, Abstract {}
|
||||
class P4(x : Int, yy : Y) : Y by yy, Abstract, X(x) {}
|
||||
|
||||
fun box() : String {
|
||||
if (new X(239).x != 239) return "FAIL #1"
|
||||
if (new Y(239).y != 239) return "FAIL #2"
|
||||
|
||||
val p = new Point(240, -1)
|
||||
if (p.x + p.y != 239) return "FAIL #3"
|
||||
|
||||
val y = new Y(-1)
|
||||
val p1 = new P1(240, y)
|
||||
if (p1.x + p1.y != 239) return "FAIL #4"
|
||||
val p2 = new P2(240, y)
|
||||
if (p2.x + p2.y != 239) return "FAIL #5"
|
||||
|
||||
val p3 = new P3(240, y)
|
||||
if (p3.x + p3.y != 239) return "FAIL #6"
|
||||
|
||||
val p4 = new P4(240, y)
|
||||
if (p4.x + p4.y != 239) return "FAIL #7"
|
||||
|
||||
"OK"
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
class Foo() : java.util.ArrayList<Int>()
|
||||
@@ -0,0 +1,8 @@
|
||||
class SimpleClass() {
|
||||
fun foo() = 610
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val c = new SimpleClass()
|
||||
return c.foo()
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
class Base() {
|
||||
public val plain = 239
|
||||
public val read : Int
|
||||
get() = 239
|
||||
|
||||
public var readwrite : Int
|
||||
get() = $readwrite + 1
|
||||
set(n : Int) {
|
||||
$readwrite = n
|
||||
}
|
||||
}
|
||||
|
||||
class Abstract {}
|
||||
|
||||
class Derived1() : Base(), Abstract {}
|
||||
class Derived2() : Abstract, Base() {}
|
||||
|
||||
fun code(s : Base) : Int {
|
||||
if (s.plain != 239) return 1
|
||||
if (s.read != 239) return 2
|
||||
s.readwrite = 238
|
||||
if (s.readwrite != 239) return 3
|
||||
return 0
|
||||
}
|
||||
|
||||
fun test(s : Base) : Boolean = code(s) == 0
|
||||
|
||||
fun box() : String {
|
||||
if (!test(new Base())) return "Fail #1"
|
||||
if (!test(new Derived1())) return "Fail #2"
|
||||
if (!test(new Derived2())) return "Fail #3"
|
||||
return "OK"
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
class SimpleClass {
|
||||
fun foo() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user