[K/N][tests] Migrate various runtime/ tests ^KT-61259
This commit is contained in:
committed by
Space Team
parent
7ad4e58a7a
commit
d88092aa94
+23
@@ -0,0 +1,23 @@
|
||||
// DISABLE_NATIVE: gcType=NOOP
|
||||
import kotlin.native.runtime.GC
|
||||
import kotlin.test.*
|
||||
|
||||
object Foo {
|
||||
val bar = Bar()
|
||||
}
|
||||
|
||||
class Bar {
|
||||
val f by lazy {
|
||||
foo()
|
||||
}
|
||||
|
||||
fun foo() = 123
|
||||
}
|
||||
|
||||
@OptIn(kotlin.native.runtime.NativeRuntimeApi::class)
|
||||
@Test
|
||||
fun test() {
|
||||
assertEquals(123, Foo.bar.f)
|
||||
GC.collect()
|
||||
assertEquals(123, Foo.bar.f)
|
||||
}
|
||||
Reference in New Issue
Block a user