tests: Update external tests (1.1.2-dev-393)
This commit is contained in:
+7
@@ -0,0 +1,7 @@
|
||||
data class A(val x: Int) {
|
||||
override fun toString(): String = "!"
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return if (A(0).toString() == "!") "OK" else "fail"
|
||||
}
|
||||
Vendored
+22
@@ -0,0 +1,22 @@
|
||||
// TODO: muted automatically, investigate should it be ran for JS or not
|
||||
// IGNORE_BACKEND: JS, NATIVE
|
||||
|
||||
// WITH_RUNTIME
|
||||
|
||||
data class A(val x: Int) {
|
||||
fun toString(other: Any): String = ""
|
||||
}
|
||||
|
||||
data class B(val x: Int) {
|
||||
fun toString(other: B, another: Any): String = ""
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
A::class.java.getDeclaredMethod("toString")
|
||||
A::class.java.getDeclaredMethod("toString", Any::class.java)
|
||||
|
||||
B::class.java.getDeclaredMethod("toString")
|
||||
B::class.java.getDeclaredMethod("toString", B::class.java, Any::class.java)
|
||||
|
||||
return "OK"
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
// TODO: muted automatically, investigate should it be ran for JS or not
|
||||
// IGNORE_BACKEND: JS
|
||||
|
||||
data class A(val x: Array<Int>?, val y: IntArray?)
|
||||
|
||||
fun box(): String {
|
||||
var ts = A(Array<Int>(2, {it}), IntArray(3)).toString()
|
||||
if(ts != "A(x=[0, 1], y=[0, 0, 0])") return ts
|
||||
|
||||
ts = A(null, IntArray(3)).toString()
|
||||
if(ts != "A(x=null, y=[0, 0, 0])") return ts
|
||||
|
||||
ts = A(null, null).toString()
|
||||
if(ts != "A(x=null, y=null)") return ts
|
||||
|
||||
return "OK"
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
data class A(var string: String)
|
||||
|
||||
fun box(): String {
|
||||
val a = A("Fail")
|
||||
if(a.toString() != "A(string=Fail)") return "fail"
|
||||
|
||||
a.string = "OK"
|
||||
if("$a" != "A(string=OK)") return a.toString()
|
||||
|
||||
return "OK"
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
data class A<T>(val x: T)
|
||||
|
||||
fun box(): String {
|
||||
val a = A(42)
|
||||
if ("$a" != "A(x=42)") return "$a"
|
||||
|
||||
val b = A(239.toLong())
|
||||
if ("$b" != "A(x=239)") return "$b"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
data class A(var x: Int, val z: Int?)
|
||||
|
||||
fun box(): String {
|
||||
val a = A(1, null)
|
||||
if("$a" != "A(x=1, z=null)") return "$a"
|
||||
return "OK"
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
data class A(val x: Unit)
|
||||
|
||||
fun box(): String {
|
||||
val a = A(Unit)
|
||||
return if ("$a" == "A(x=kotlin.Unit)") "OK" else "$a"
|
||||
}
|
||||
Reference in New Issue
Block a user