[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,8 +3,6 @@
* that can be found in the LICENSE file.
*/
package codegen.funInterface.implIsNotFunction
import kotlin.test.*
fun interface Foo {
@@ -13,7 +11,7 @@ fun interface Foo {
fun foo(f: Foo) = f is Function<*>
@Test
fun test() {
fun box(): String {
assertFalse(foo { "zzz" })
return "OK"
}
@@ -3,7 +3,6 @@
* that can be found in the LICENSE file.
*/
@file:OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)
package codegen.funInterface.kt43887
import kotlin.test.*
@@ -27,12 +26,14 @@ inline fun CPointer<heap_t>?.free(ptr: CPointer<*>?): Boolean {
return heap_free(this, ptr)?.pointed?.value ?: false
}
@Test
fun runTest(): Unit = memScoped {
fun box(): String {
memScoped {
val heap = Heap(1024)
heap.use<IntVar> { ptr ->
ptr.pointed.value = 40
//println("PTR ${ptr.pointed}")
}
}
return "OK"
}
@@ -3,8 +3,6 @@
* that can be found in the LICENSE file.
*/
package codegen.funInterface.kt49384
import kotlin.test.*
interface A<T>
@@ -17,20 +15,9 @@ class B<T> {
}
}
@Test
fun test1() {
fun box(): String {
val b = B<Any>()
assertEquals(b, b) // Just to ensure B is not deleted by DCE
}
fun interface Foo<T> {
fun same(obj: T): T
}
fun getSame(obj: A<out Any>, foo: Foo<A<out Any>>) = foo.same(obj)
@Test
fun test2() {
val obj = object : A<Any> {}
assertSame(obj, getSame(obj) { it })
return "OK"
}
@@ -0,0 +1,22 @@
/*
* Copyright 2010-2021 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.
*/
import kotlin.test.*
interface A<T>
// https://youtrack.jetbrains.com/issue/KT-49384
fun interface Foo<T> {
fun same(obj: T): T
}
fun getSame(obj: A<out Any>, foo: Foo<A<out Any>>) = foo.same(obj)
fun box(): String {
val obj = object : A<Any> {}
assertSame(obj, getSame(obj) { it })
return "OK"
}
@@ -3,15 +3,13 @@
* that can be found in the LICENSE file.
*/
package codegen.funInterface.nonTrivialProjectionInSuperType
import kotlin.test.*
fun <T> foo(comparator: kotlin.Comparator<in T>, a: T, b: T) = comparator.compare(a, b)
fun bar(x: Int, y: Int) = foo<Int> ({ a, b -> a - b}, x, y)
@Test
fun test() {
fun box(): String {
assertTrue(bar(42, 117) < 0)
return "OK"
}