[K/N][Tests] Move codegen test sources interfaceCallsNCasts..vector

^KT-61259
This commit is contained in:
Vladimir Sukharev
2023-12-15 00:13:04 +01:00
committed by Space Team
parent 56e1c5cbc6
commit 93642020ff
182 changed files with 2023 additions and 686 deletions
@@ -0,0 +1,21 @@
/*
* 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.
*/
package codegen.propertyCallableReference.dynamicReceiver
import kotlin.test.*
class TestClass {
var x: Int = 42
}
fun foo(): TestClass {
println(42)
return TestClass()
}
@Test fun runTest() {
foo()::x
}
@@ -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.
*/
package codegen.propertyCallableReference.valClass
import kotlin.test.*
class A(val x: Int)
@Test fun runTest() {
val p1 = A::x
println(p1.get(A(42)))
val a = A(117)
val p2 = a::x
println(p2.get())
}
@@ -0,0 +1,2 @@
42
117
@@ -0,0 +1,22 @@
/*
* 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.
*/
package codegen.propertyCallableReference.valExtension
import kotlin.test.*
class A(y: Int) {
var x = y
}
val A.z get() = this.x
@Test fun runTest() {
val p1 = A::z
println(p1.get(A(42)))
val a = A(117)
val p2 = a::z
println(p2.get())
}
@@ -0,0 +1,2 @@
42
117
@@ -0,0 +1,15 @@
/*
* 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.
*/
package codegen.propertyCallableReference.valModule
import kotlin.test.*
val x = 42
@Test fun runTest() {
val p = ::x
println(p.get())
}
@@ -0,0 +1 @@
42
@@ -0,0 +1,22 @@
/*
* 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.
*/
package codegen.propertyCallableReference.varClass
import kotlin.test.*
class A(var x: Int)
@Test fun runTest() {
val p1 = A::x
val a = A(42)
p1.set(a, 117)
println(a.x)
println(p1.get(a))
val p2 = a::x
p2.set(42)
println(a.x)
println(p2.get())
}
@@ -0,0 +1,4 @@
117
117
42
42
@@ -0,0 +1,30 @@
/*
* 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.
*/
package codegen.propertyCallableReference.varExtension
import kotlin.test.*
class A(y: Int) {
var x = y
}
var A.z: Int
get() = this.x
set(value: Int) {
this.x = value
}
@Test fun runTest() {
val p1 = A::z
val a = A(42)
p1.set(a, 117)
println(a.x)
println(p1.get(a))
val p2 = a::z
p2.set(42)
println(a.x)
println(p2.get())
}
@@ -0,0 +1,4 @@
117
117
42
42
@@ -0,0 +1,17 @@
/*
* 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.
*/
package codegen.propertyCallableReference.varModule
import kotlin.test.*
var x = 42
@Test fun runTest() {
val p = ::x
p.set(117)
println(x)
println(p.get())
}
@@ -0,0 +1,2 @@
117
117