[K/N][Tests] Adjust moved tests interfaceCallsNCasts..vector to new infra

^KT-61259
This commit is contained in:
Vladimir Sukharev
2023-12-16 23:54:04 +01:00
committed by Space Team
parent 93642020ff
commit bb8a7b6795
163 changed files with 841 additions and 672 deletions
@@ -3,8 +3,6 @@
* that can be found in the LICENSE file.
*/
package codegen.`object`.constructor0
import kotlin.test.*
class A {
@@ -13,3 +11,8 @@ class A {
field0 = arg0
}
}
fun box(): String {
assertEquals(42, A(42).field0)
return "OK"
}
+6 -6
View File
@@ -3,8 +3,6 @@
* that can be found in the LICENSE file.
*/
package codegen.`object`.fields
import kotlin.test.*
private var globalValue = 1
@@ -18,8 +16,10 @@ fun globalTest(i:Int):Int {
}
@Test fun runTest() {
if (global != 1) throw Error()
if (globalTest(41) != 42) throw Error()
if (global != 42) throw Error()
fun box(): String {
assertEquals(1, global)
assertEquals(42, globalTest(41))
assertEquals(42, global)
return "OK"
}
+6 -5
View File
@@ -3,8 +3,6 @@
* that can be found in the LICENSE file.
*/
package codegen.`object`.fields1
import kotlin.test.*
class B(val a:Int, b:Int) {
@@ -16,7 +14,10 @@ fun primaryConstructorCall(a:Int, b:Int) = B(a, b).pos
fun secondaryConstructorCall(a:Int) = B(a).pos
@Test fun runTest() {
if (primaryConstructorCall(0xdeadbeef.toInt(), 41) != 42) throw Error()
if (secondaryConstructorCall(41) != 42) throw Error()
fun box(): String {
assertEquals(42, primaryConstructorCall(0xdeadbeef.toInt(), 41))
assertEquals(42, secondaryConstructorCall(41))
return "OK"
}
+18 -22
View File
@@ -3,33 +3,33 @@
* that can be found in the LICENSE file.
*/
package codegen.`object`.fields2
import kotlin.test.*
val sb = StringBuilder()
var global: Int = 0
get() {
println("Get global = $field")
sb.appendLine("Get global = $field")
return field
}
set(value) {
println("Set global = $value")
sb.appendLine("Set global = $value")
field = value
}
class TestClass {
var member: Int = 0
get() {
println("Get member = $field")
sb.appendLine("Get member = $field")
return field
}
set(value) {
println("Set member = $value")
sb.appendLine("Set member = $value")
field = value
}
}
@Test fun runTest1() {
fun box(): String {
global = 1
val test = TestClass()
@@ -37,19 +37,15 @@ class TestClass {
global = test.member
test.member = global
}
@ThreadLocal
val xInt = 42
@ThreadLocal
val xString = "42"
@ThreadLocal
val xAny = Any()
@Test fun runTest2() {
assertEquals(42, xInt)
assertEquals("42", xString)
assertTrue(xAny is Any)
assertEquals("""
Set global = 1
Set member = 42
Get member = 42
Set global = 42
Get global = 42
Set member = 42
""".trimIndent(), sb.toString())
return "OK"
}
@@ -1,6 +0,0 @@
Set global = 1
Set member = 42
Get member = 42
Set global = 42
Get global = 42
Set member = 42
@@ -9,4 +9,9 @@ public val z: Any = Z
private object Z
fun main(args: Array<String>) { }
fun box(): String {
if (z is Z)
return "OK"
else
return "FAIL"
}
+7 -2
View File
@@ -3,8 +3,6 @@
* that can be found in the LICENSE file.
*/
package codegen.`object`.init0
import kotlin.test.*
class A(a:Int) {
@@ -12,4 +10,11 @@ class A(a:Int) {
init {
if (a == 0) i = 1
}
}
fun box(): String {
assertEquals(1, A(0).i)
assertEquals(0, A(1).i)
return "OK"
}
@@ -3,8 +3,6 @@
* that can be found in the LICENSE file.
*/
package codegen.`object`.initialization
import kotlin.test.*
open class A(val a:Int, val b:Int)
@@ -28,6 +26,7 @@ fun foo(i:Int, j:Int):Int {
return c.c
}
@Test fun runTest() {
if (foo(2, 3) != 5) throw Error()
fun box(): String {
assertEquals(5, foo(2, 3))
return "OK"
}
@@ -3,27 +3,39 @@
* that can be found in the LICENSE file.
*/
package codegen.`object`.initialization1
import kotlin.test.*
val sb = StringBuilder()
class TestClass {
constructor() {
println("constructor1")
sb.appendLine("constructor1")
}
constructor(x: Int) : this() {
println("constructor2")
sb.appendLine("constructor2")
}
init {
println("init")
sb.appendLine("init")
}
val f = println("field")
val f = sb.appendLine("field")
}
@Test fun runTest() {
fun box(): String {
TestClass()
TestClass(1)
assertEquals("""
init
field
constructor1
init
field
constructor1
constructor2
""".trimIndent(), sb.toString())
return "OK"
}
@@ -1,7 +0,0 @@
init
field
constructor1
init
field
constructor1
constructor2
+3 -4
View File
@@ -3,8 +3,6 @@
* that can be found in the LICENSE file.
*/
package codegen.`object`.method_call
import kotlin.test.*
class A(val a:Int) {
@@ -13,6 +11,7 @@ class A(val a:Int) {
fun fortyTwo() = A(41).foo(1)
@Test fun runTest() {
if (fortyTwo() != 42) throw Error()
fun box(): String {
assertEquals(42, fortyTwo())
return "OK"
}