backend/tests: Add blackbox tests from Kotlin JVM
Added tests from testData/codegen/box directory. There are blackbox tests in other directories and they are to be added.
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
fun isNull(x: Unit?) = x == null
|
||||
|
||||
fun <T : Any> isNullGeneric(x: T?) = x == null
|
||||
|
||||
fun deepIsNull0(x: Unit?) = isNull(x)
|
||||
fun deepIsNull(x: Unit?) = deepIsNull0(x)
|
||||
|
||||
fun box(): String {
|
||||
if (!isNull(null)) return "Fail 1"
|
||||
|
||||
val x: Unit? = null
|
||||
if (!isNull(x)) return "Fail 2"
|
||||
|
||||
val y = x
|
||||
if (!isNullGeneric(y)) return "Fail 3"
|
||||
|
||||
if (!deepIsNull(x ?: null)) return "Fail 4"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user