Remove duplicate tests from JS compiler test set. Merge chages to common compiler tests
This commit is contained in:
@@ -1,28 +0,0 @@
|
||||
// EXPECTED_REACHABLE_NODES: 1297
|
||||
// This test was adapted from compiler/testData/codegen/box/classes
|
||||
package foo
|
||||
|
||||
interface Trait1 {
|
||||
fun foo(): String
|
||||
}
|
||||
|
||||
interface Trait2 {
|
||||
fun bar(): String
|
||||
}
|
||||
|
||||
class T1 : Trait1 {
|
||||
override fun foo() = "aaa"
|
||||
}
|
||||
|
||||
class T2 : Trait2 {
|
||||
override fun bar() = "bbb"
|
||||
}
|
||||
|
||||
class C(a: Trait1, b: Trait2) : Trait1 by a, Trait2 by b
|
||||
|
||||
fun box(): String {
|
||||
val c = C(T1(), T2())
|
||||
if (c.foo() != "aaa") return "fail"
|
||||
if (c.bar() != "bbb") return "fail"
|
||||
return "OK"
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
// EXPECTED_REACHABLE_NODES: 1304
|
||||
// This test was adapted from compiler/testData/codegen/box/classes
|
||||
package foo
|
||||
|
||||
interface One {
|
||||
public open fun foo(): Int
|
||||
public open fun faz(): Int = 10
|
||||
}
|
||||
interface Two {
|
||||
public open fun foo(): Int
|
||||
public open fun quux(): Int = 100
|
||||
}
|
||||
|
||||
class OneImpl : One {
|
||||
public override fun foo() = 1
|
||||
}
|
||||
class TwoImpl : Two {
|
||||
public override fun foo() = 2
|
||||
}
|
||||
|
||||
class Test2(a: One, b: Two) : Two by b, One by a {
|
||||
public override fun foo() = 0
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
var t2 = Test2(OneImpl(), TwoImpl())
|
||||
if (t2.foo() != 0)
|
||||
return "Fail #1"
|
||||
if (t2.faz() != 10)
|
||||
return "Fail #2"
|
||||
if (t2.quux() != 100)
|
||||
return "Fail #3"
|
||||
if (t2 !is One)
|
||||
return "Fail #4"
|
||||
if (t2 !is Two)
|
||||
return "Fail #5"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
// EXPECTED_REACHABLE_NODES: 1294
|
||||
// This test was adapted from compiler/testData/codegen/box/classes
|
||||
package foo
|
||||
|
||||
interface First {
|
||||
public open fun foo(): Int
|
||||
}
|
||||
|
||||
interface Second : First {
|
||||
public open fun bar(): Int
|
||||
}
|
||||
|
||||
class Impl : Second {
|
||||
public override fun foo() = 1
|
||||
public override fun bar() = 2
|
||||
}
|
||||
|
||||
class Test(s: Second) : Second by s {}
|
||||
|
||||
fun box(): String {
|
||||
var t = Test(Impl())
|
||||
if (t.foo() != 1)
|
||||
return "Fail #1"
|
||||
if (t.bar() != 2)
|
||||
return "Fail #2"
|
||||
if (t !is First)
|
||||
return "Fail #3"
|
||||
if (t !is Second)
|
||||
return "Fail #4"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
// EXPECTED_REACHABLE_NODES: 1290
|
||||
// This test was adapted from compiler/testData/codegen/box/classes
|
||||
package foo
|
||||
|
||||
interface A<T> {
|
||||
fun foo(t: T): String
|
||||
}
|
||||
|
||||
class Derived(a: A<Int>) : A<Int> by a
|
||||
|
||||
fun box(): String {
|
||||
val o = object : A<Int> {
|
||||
override fun foo(t: Int) = if (t == 42) "OK" else "Fail $t"
|
||||
}
|
||||
return Derived(o).foo(42)
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
// EXPECTED_REACHABLE_NODES: 1298
|
||||
// This test was adapted from compiler/testData/codegen/box/classes
|
||||
package foo
|
||||
|
||||
interface TextField {
|
||||
fun getText(): String
|
||||
}
|
||||
|
||||
interface InputTextField : TextField {
|
||||
fun setText(text: String)
|
||||
}
|
||||
|
||||
interface MooableTextField : InputTextField {
|
||||
fun moo(a: Int, b: Int, c: Int): Int
|
||||
}
|
||||
|
||||
class SimpleTextField : MooableTextField {
|
||||
private var text2 = ""
|
||||
override fun getText() = text2
|
||||
override fun setText(text: String) {
|
||||
this.text2 = text
|
||||
}
|
||||
override fun moo(a: Int, b: Int, c: Int) = a + b + c
|
||||
}
|
||||
|
||||
class TextFieldWrapper(textField: MooableTextField) : MooableTextField by textField
|
||||
|
||||
fun box(): String {
|
||||
val textField = TextFieldWrapper(SimpleTextField())
|
||||
textField.setText("hello world!")
|
||||
|
||||
if (!textField.getText().equals("hello world!")) return "FAIL #!1"
|
||||
if (textField.moo(1, 2, 3) != 6) return "FAIL #2"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user