[K/N][Tests] Adjust moved tests interfaceCallsNCasts..vector to new infra
^KT-61259
This commit is contained in:
committed by
Space Team
parent
93642020ff
commit
bb8a7b6795
@@ -3,18 +3,25 @@
|
||||
* that can be found in the LICENSE file.
|
||||
*/
|
||||
|
||||
package codegen.lateinit.globalIsInitialized
|
||||
|
||||
import kotlin.test.*
|
||||
|
||||
val sb = StringBuilder()
|
||||
|
||||
lateinit var s: String
|
||||
|
||||
fun foo() {
|
||||
println(::s.isInitialized)
|
||||
sb.appendLine(::s.isInitialized)
|
||||
}
|
||||
|
||||
@Test fun runTest() {
|
||||
fun box(): String {
|
||||
foo()
|
||||
s = "zzz"
|
||||
foo()
|
||||
|
||||
assertEquals("""
|
||||
false
|
||||
true
|
||||
|
||||
""".trimIndent(), sb.toString())
|
||||
return "OK"
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
false
|
||||
true
|
||||
@@ -3,8 +3,6 @@
|
||||
* that can be found in the LICENSE file.
|
||||
*/
|
||||
|
||||
package codegen.lateinit.inBaseClass
|
||||
|
||||
import kotlin.test.*
|
||||
|
||||
class A(val a: Int)
|
||||
@@ -17,8 +15,10 @@ class C: B() {
|
||||
fun foo() { a = A(42) }
|
||||
}
|
||||
|
||||
@Test fun runTest() {
|
||||
fun box(): String {
|
||||
val c = C()
|
||||
c.foo()
|
||||
println(c.a.a)
|
||||
assertEquals(42, c.a.a)
|
||||
|
||||
return "OK"
|
||||
}
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
42
|
||||
@@ -3,8 +3,6 @@
|
||||
* that can be found in the LICENSE file.
|
||||
*/
|
||||
|
||||
package codegen.lateinit.initialized
|
||||
|
||||
import kotlin.test.*
|
||||
|
||||
class A {
|
||||
@@ -13,8 +11,8 @@ class A {
|
||||
fun foo() = s
|
||||
}
|
||||
|
||||
@Test fun runTest() {
|
||||
fun box(): String {
|
||||
val a = A()
|
||||
a.s = "zzz"
|
||||
println(a.foo())
|
||||
a.s = "OK"
|
||||
return a.foo()
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
zzz
|
||||
@@ -3,8 +3,6 @@
|
||||
* that can be found in the LICENSE file.
|
||||
*/
|
||||
|
||||
package codegen.lateinit.innerIsInitialized
|
||||
|
||||
import kotlin.test.*
|
||||
|
||||
open class Foo {
|
||||
@@ -23,6 +21,6 @@ open class Foo {
|
||||
}
|
||||
}
|
||||
|
||||
@Test fun runTest() {
|
||||
println(Foo().test())
|
||||
fun box(): String {
|
||||
return Foo().test()
|
||||
}
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
OK
|
||||
@@ -3,21 +3,28 @@
|
||||
* that can be found in the LICENSE file.
|
||||
*/
|
||||
|
||||
package codegen.lateinit.isInitialized
|
||||
|
||||
import kotlin.test.*
|
||||
|
||||
val sb = StringBuilder()
|
||||
|
||||
class A {
|
||||
lateinit var s: String
|
||||
|
||||
fun foo() {
|
||||
println(::s.isInitialized)
|
||||
sb.appendLine(::s.isInitialized)
|
||||
}
|
||||
}
|
||||
|
||||
@Test fun runTest() {
|
||||
fun box(): String {
|
||||
val a = A()
|
||||
a.foo()
|
||||
a.s = "zzz"
|
||||
a.foo()
|
||||
|
||||
assertEquals("""
|
||||
false
|
||||
true
|
||||
|
||||
""".trimIndent(), sb.toString())
|
||||
return "OK"
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
false
|
||||
true
|
||||
@@ -3,15 +3,13 @@
|
||||
* that can be found in the LICENSE file.
|
||||
*/
|
||||
|
||||
package codegen.lateinit.localCapturedInitialized
|
||||
|
||||
import kotlin.test.*
|
||||
|
||||
@Test fun runTest() {
|
||||
fun box(): String {
|
||||
lateinit var s: String
|
||||
|
||||
fun foo() = s
|
||||
|
||||
s = "zzz"
|
||||
println(foo())
|
||||
s = "OK"
|
||||
return foo()
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
zzz
|
||||
+7
-7
@@ -3,21 +3,21 @@
|
||||
* that can be found in the LICENSE file.
|
||||
*/
|
||||
|
||||
package codegen.lateinit.localCapturedNotInitialized
|
||||
|
||||
import kotlin.test.*
|
||||
|
||||
@Test fun runTest() {
|
||||
val sb = StringBuilder()
|
||||
|
||||
fun box(): String {
|
||||
lateinit var s: String
|
||||
|
||||
fun foo() = s
|
||||
|
||||
try {
|
||||
println(foo())
|
||||
sb.appendLine(foo())
|
||||
}
|
||||
catch (e: RuntimeException) {
|
||||
println("OK")
|
||||
return
|
||||
sb.append("OK")
|
||||
return sb.toString()
|
||||
}
|
||||
println("Fail")
|
||||
return "Fail"
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
OK
|
||||
@@ -3,12 +3,10 @@
|
||||
* that can be found in the LICENSE file.
|
||||
*/
|
||||
|
||||
package codegen.lateinit.localInitialized
|
||||
|
||||
import kotlin.test.*
|
||||
|
||||
@Test fun runTest() {
|
||||
fun box(): String {
|
||||
lateinit var s: String
|
||||
s = "zzz"
|
||||
println(s)
|
||||
s = "OK"
|
||||
return s
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
zzz
|
||||
@@ -3,19 +3,19 @@
|
||||
* that can be found in the LICENSE file.
|
||||
*/
|
||||
|
||||
package codegen.lateinit.localNotInitialized
|
||||
|
||||
import kotlin.test.*
|
||||
|
||||
@Test fun runTest() {
|
||||
val sb = StringBuilder()
|
||||
|
||||
fun box(): String {
|
||||
lateinit var s: String
|
||||
|
||||
try {
|
||||
println(s)
|
||||
sb.appendLine(s)
|
||||
}
|
||||
catch (e: RuntimeException) {
|
||||
println("OK")
|
||||
return
|
||||
sb.append("OK")
|
||||
return sb.toString()
|
||||
}
|
||||
println("Fail")
|
||||
return "Fail"
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
OK
|
||||
@@ -3,8 +3,6 @@
|
||||
* that can be found in the LICENSE file.
|
||||
*/
|
||||
|
||||
package codegen.lateinit.notInitialized
|
||||
|
||||
import kotlin.test.*
|
||||
|
||||
class A {
|
||||
@@ -13,14 +11,16 @@ class A {
|
||||
fun foo() = s
|
||||
}
|
||||
|
||||
@Test fun runTest() {
|
||||
val sb = StringBuilder()
|
||||
|
||||
fun box(): String {
|
||||
val a = A()
|
||||
try {
|
||||
println(a.foo())
|
||||
sb.appendLine(a.foo())
|
||||
}
|
||||
catch (e: RuntimeException) {
|
||||
println("OK")
|
||||
return
|
||||
sb.append("OK")
|
||||
return sb.toString()
|
||||
}
|
||||
println("Fail")
|
||||
return "Fail"
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
OK
|
||||
Reference in New Issue
Block a user