[Tests] Migrate backend-independent tests from native to compiler/testData.

^KT-65979
This commit is contained in:
Vladimir Sukharev
2024-02-25 18:25:58 +01:00
committed by Space Team
parent dd9332d9e1
commit febac0dd5f
640 changed files with 68168 additions and 6313 deletions
@@ -0,0 +1,9 @@
MODULE main
CLASS DynamicReceiverKt.class
PACKAGE METADATA
PROPERTY getSb()Ljava/lang/StringBuilder;
Property: class.metadata.property.returnType
K1
java/lang/StringBuilder /* = kotlin/text/StringBuilder^ */
K2
java/lang/StringBuilder
@@ -0,0 +1,26 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the LICENSE file.
*/
// JVM_ABI_K1_K2_DIFF: KT-63864
// WITH_STDLIB
import kotlin.test.*
val sb = StringBuilder()
class TestClass {
var x: Int = 42
}
fun foo(): TestClass {
sb.append(42)
return TestClass()
}
fun box(): String {
foo()::x
assertEquals("42", sb.toString())
return "OK"
}
@@ -0,0 +1,18 @@
// MODULE: lib
// FILE: lib.kt
package a
class A(val x: String)
// MODULE: main(lib)
// FILE: main.kt
import a.*
fun box(): String {
val p1 = A::x
val a = A("K")
val p2 = a::x
return p1.get(A("O")) + p2.get()
}
@@ -0,0 +1,19 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the LICENSE file.
*/
// WITH_STDLIB
import kotlin.test.*
class A(val x: Int)
fun box(): String {
val p1 = A::x
assertEquals(42, p1.get(A(42)))
val a = A(117)
val p2 = a::x
assertEquals(117, p2.get())
return "OK"
}
@@ -0,0 +1,23 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the LICENSE file.
*/
// WITH_STDLIB
import kotlin.test.*
class A(y: Int) {
var x = y
}
val A.z get() = this.x
fun box(): String {
val p1 = A::z
assertEquals(42, p1.get(A(42)))
val a = A(117)
val p2 = a::z
assertEquals(117, p2.get())
return "OK"
}
@@ -0,0 +1,16 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the LICENSE file.
*/
// WITH_STDLIB
import kotlin.test.*
val x = 42
fun box(): String {
val p = ::x
assertEquals(42, p.get())
return "OK"
}
@@ -0,0 +1,23 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the LICENSE file.
*/
// WITH_STDLIB
import kotlin.test.*
class A(var x: Int)
fun box(): String {
val p1 = A::x
val a = A(42)
p1.set(a, 117)
assertEquals(117, a.x)
assertEquals(117, p1.get(a))
val p2 = a::x
p2.set(42)
assertEquals(42, a.x)
assertEquals(42, p2.get())
return "OK"
}
@@ -0,0 +1,31 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the LICENSE file.
*/
// WITH_STDLIB
import kotlin.test.*
class A(y: Int) {
var x = y
}
var A.z: Int
get() = this.x
set(value: Int) {
this.x = value
}
fun box(): String {
val p1 = A::z
val a = A(42)
p1.set(a, 117)
assertEquals(117, a.x)
assertEquals(117, p1.get(a))
val p2 = a::z
p2.set(42)
assertEquals(42, a.x)
assertEquals(42, p2.get())
return "OK"
}
@@ -0,0 +1,18 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the LICENSE file.
*/
// WITH_STDLIB
import kotlin.test.*
var x = 42
fun box(): String {
val p = ::x
p.set(117)
assertEquals(117, x)
assertEquals(117, p.get())
return "OK"
}