[K/N][Tests] Adjust moved codegen tests to new infra

^KT-61259
This commit is contained in:
Vladimir Sukharev
2023-12-14 20:14:47 +01:00
committed by Space Team
parent 71a834b778
commit 73032213f0
295 changed files with 1362 additions and 1145 deletions
@@ -3,13 +3,17 @@
* that can be found in the LICENSE file.
*/
import kotlin.test.*
val sb = StringBuilder()
interface I {
fun foo()
}
fun test() {
val impl = object : I {
override fun foo() { println("zzz") }
override fun foo() { sb.append("zzz") }
}
val delegating = object: I by impl { }
@@ -17,6 +21,9 @@ fun test() {
delegating.foo()
}
fun main() {
fun box(): String {
test()
assertEquals("zzz", sb.toString())
return "OK"
}
@@ -1 +0,0 @@
zzz
@@ -1,5 +1,5 @@
class Foo(val box: String = "box")
class Foo(val box: String = "OK")
fun main() {
println(Foo().box)
fun box(): String {
return Foo().box
}
@@ -1,3 +1,5 @@
import kotlin.test.*
interface Base { val id: Int }
inline class Child(override val id: Int = 1) : Base
@@ -5,9 +7,11 @@ inline class Child(override val id: Int = 1) : Base
interface Base2 { val prop: Base }
class Child2(override val prop: Child) : Base2
fun main() {
fun box(): String {
val x : Base = Child(5)
println(x.id)
assertEquals(5, x.id)
val y : Base2 = Child2(Child(5))
println(y.prop)
assertEquals("Child(id=5)", y.prop.toString())
return "OK"
}
@@ -1,2 +0,0 @@
5
Child(id=5)
@@ -1,3 +1,4 @@
import kotlin.test.*
interface I {
fun foo(): Int
}
@@ -10,5 +11,10 @@ fun main(args: Array<String>) {
lateinit var a: I
if (args.size == 0)
a = A()
println(a.foo())
}
assertEquals(42, a.foo())
}
fun box(): String {
main(emptyArray())
return "OK"
}
@@ -1 +0,0 @@
42