tests: Update external tests (1.1.2-dev-393)
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
fun test(
|
||||
b: Boolean,
|
||||
i: Int
|
||||
) {
|
||||
if (b) {
|
||||
when (i) {
|
||||
0 -> foo(1)
|
||||
else -> null
|
||||
}
|
||||
} else null
|
||||
}
|
||||
|
||||
fun foo(i: Int) = i
|
||||
|
||||
fun box(): String {
|
||||
test(true, 1)
|
||||
return "OK"
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fun box(): String {
|
||||
if (1F != 1.toFloat()) return "fail 1"
|
||||
if (1.0F != 1.0.toFloat()) return "fail 2"
|
||||
if (1e1F != 1e1.toFloat()) return "fail 3"
|
||||
if (1.0e1F != 1.0e1.toFloat()) return "fail 4"
|
||||
if (1e-1F != 1e-1.toFloat()) return "fail 5"
|
||||
if (1.0e-1F != 1.0e-1.toFloat()) return "fail 6"
|
||||
|
||||
if (1f != 1.toFloat()) return "fail 7"
|
||||
if (1.0f != 1.0.toFloat()) return "fail 8"
|
||||
if (1e1f != 1e1.toFloat()) return "fail 9"
|
||||
if (1.0e1f != 1.0e1.toFloat()) return "fail 10"
|
||||
if (1e-1f != 1e-1.toFloat()) return "fail 11"
|
||||
if (1.0e-1f != 1.0e-1.toFloat()) return "fail 12"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
// TODO: muted automatically, investigate should it be ran for JS or not
|
||||
// IGNORE_BACKEND: JS
|
||||
|
||||
object A {
|
||||
const val a: String = "$"
|
||||
const val b = "1234$a"
|
||||
const val c = 10000
|
||||
|
||||
val bNonConst = "1234$a"
|
||||
val bNullable: String = "1234$a"
|
||||
}
|
||||
|
||||
object B {
|
||||
const val a: String = "$"
|
||||
const val b = "1234$a"
|
||||
const val c = 10000
|
||||
|
||||
val bNonConst = "1234$a"
|
||||
val bNullable: String = "1234$a"
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
if (A.a !== B.a) return "Fail 1: A.a !== B.a"
|
||||
|
||||
if (A.b !== B.b) return "Fail 2: A.b !== B.b"
|
||||
|
||||
if (A.c !== B.c) return "Fail 3: A.c !== B.c"
|
||||
|
||||
if (A.bNonConst === B.bNonConst) return "Fail 5: A.bNonConst == B.bNonConst"
|
||||
if (A.bNullable === B.bNullable) return "Fail 6: A.bNullable == B.bNullable"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
fun box(): String {
|
||||
if (1L != 1.toLong()) return "fail 1"
|
||||
if (0x1L != 0x1.toLong()) return "fail 2"
|
||||
if (0X1L != 0X1.toLong()) return "fail 3"
|
||||
if (0b1L != 0b1.toLong()) return "fail 4"
|
||||
if (0B1L != 0B1.toLong()) return "fail 5"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
private const val z = "OK";
|
||||
|
||||
fun box(): String {
|
||||
return {
|
||||
z
|
||||
}()
|
||||
}
|
||||
Reference in New Issue
Block a user