Minor, move old Java nullability assertion tests under oldLanguageVersions/

Also drop the (now confusing) "_lv12" suffix from newer tests
This commit is contained in:
Alexander Udalov
2019-11-20 18:59:56 +01:00
parent 16e76fb75a
commit bf06d381b9
16 changed files with 216 additions and 152 deletions
@@ -0,0 +1,17 @@
// !LANGUAGE: -NullabilityAssertionOnExtensionReceiver
// TARGET_BACKEND: JVM
// FILE: test.kt
// WITH_RUNTIME
private operator fun A.inc() = A()
fun box(): String {
var aNull = A.n()
aNull++
// NB no exception is thrown in language version 1.1
return "OK"
}
// FILE: A.java
public class A {
public static A n() { return null; }
}
@@ -0,0 +1,23 @@
// !LANGUAGE: -NullabilityAssertionOnExtensionReceiver
// IGNORE_BACKEND_FIR: JVM_IR
// TARGET_BACKEND: JVM
// FILE: test.kt
// WITH_RUNTIME
import kotlin.test.*
operator fun A.inc() = A()
fun box(): String {
assertFailsWith<IllegalArgumentException> {
var aNull = A.n()
aNull++
}
return "OK"
}
// FILE: A.java
public class A {
public static A n() { return null; }
}
@@ -0,0 +1,18 @@
// !LANGUAGE: -NullabilityAssertionOnExtensionReceiver
// IGNORE_BACKEND_FIR: JVM_IR
// TARGET_BACKEND: JVM
// WITH_RUNTIME
// FILE: test.kt
import kotlin.test.*
fun String.extension() {}
fun box(): String {
assertFailsWith<IllegalArgumentException> { J.s().extension() }
return "OK"
}
// FILE: J.java
public class J {
public static String s() { return null; }
}
@@ -0,0 +1,17 @@
// !LANGUAGE: -NullabilityAssertionOnExtensionReceiver
// TARGET_BACKEND: JVM
// WITH_RUNTIME
// FILE: test.kt
import kotlin.test.*
inline fun String.extension() {}
fun box(): String {
J.s().extension() // NB no exception thrown
return "OK"
}
// FILE: J.java
public class J {
public static String s() { return null; }
}