This commit is contained in:
Igor Chevdar
2021-09-09 11:43:21 +05:00
parent feeeb16377
commit 23a02be169
3 changed files with 66 additions and 10 deletions
@@ -0,0 +1,44 @@
/*
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
// FILE: lib.kt
var z1 = false
var z2 = false
var t1 = false
var t2 = false
// FILE: lib2.kt
import kotlin.test.*
private val x = foo()
private fun foo(): Int {
z1 = true
return 42
}
@Test
fun test1() {
t1 = true
assertTrue(z1)
assertTrue(t2 || !z2)
}
// FILE: main.kt
import kotlin.test.*
private val x = foo()
private fun foo(): Int {
z2 = true
return 42
}
@Test
fun test2() {
t2 = true
assertTrue(z2)
assertTrue(t1 || !z1)
}