tests: Update external tests (1.1.2-dev-393)
This commit is contained in:
@@ -27,6 +27,7 @@ dependencies {
|
|||||||
|
|
||||||
def testOutputRoot = rootProject.file("test.output").absolutePath
|
def testOutputRoot = rootProject.file("test.output").absolutePath
|
||||||
def externalTestsDir = project.file("external")
|
def externalTestsDir = project.file("external")
|
||||||
|
externalTestsDir.mkdirs()
|
||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
// Root directories for test output (logs, compiled files, statistics etc). Only single path must be in each set.
|
// Root directories for test output (logs, compiled files, statistics etc). Only single path must be in each set.
|
||||||
|
|||||||
-6
@@ -1,6 +0,0 @@
|
|||||||
// Enable when callable references to builtin members is supported
|
|
||||||
// IGNORE_BACKEND: JS, NATIVE
|
|
||||||
fun box(): String {
|
|
||||||
val f = "KOTLIN"::get
|
|
||||||
return "${f(1)}${f(0)}"
|
|
||||||
}
|
|
||||||
Vendored
-6
@@ -1,6 +0,0 @@
|
|||||||
// TODO: muted automatically, investigate should it be ran for JS or not
|
|
||||||
// IGNORE_BACKEND: JS, NATIVE
|
|
||||||
|
|
||||||
class A
|
|
||||||
|
|
||||||
fun box() = if ((A::equals)(A(), A())) "Fail" else "OK"
|
|
||||||
backend.native/tests/external/codegen/blackbox/callableReference/function/local/localFunctionName.kt
Vendored
-8
@@ -1,8 +0,0 @@
|
|||||||
// TODO: muted automatically, investigate should it be ran for JS or not
|
|
||||||
// IGNORE_BACKEND: JS, NATIVE
|
|
||||||
|
|
||||||
fun box(): String {
|
|
||||||
fun OK() {}
|
|
||||||
|
|
||||||
return ::OK.name
|
|
||||||
}
|
|
||||||
-47
@@ -1,47 +0,0 @@
|
|||||||
// IGNORE_BACKEND: NATIVE
|
|
||||||
// WITH_RUNTIME
|
|
||||||
// WITH_COROUTINES
|
|
||||||
import kotlin.coroutines.*
|
|
||||||
|
|
||||||
|
|
||||||
// Does not work in JVM backend, probably due to bug. It's not clear which behaviour is right.
|
|
||||||
// TODO: fix the bug and enable for JVM backend
|
|
||||||
// TARGET_BACKEND: JS
|
|
||||||
|
|
||||||
class Controller {
|
|
||||||
var result = ""
|
|
||||||
|
|
||||||
suspend fun <T> suspendAndLog(value: T): T = CoroutineIntrinsics.suspendCoroutineOrReturn { c ->
|
|
||||||
result += "suspend($value);"
|
|
||||||
c.resume(value)
|
|
||||||
CoroutineIntrinsics.SUSPENDED
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun builder(c: suspend Controller.() -> String): String {
|
|
||||||
val controller = Controller()
|
|
||||||
c.startCoroutine(controller, handleResultContinuation {
|
|
||||||
controller.result += "return($it);"
|
|
||||||
})
|
|
||||||
return controller.result
|
|
||||||
}
|
|
||||||
|
|
||||||
fun <T> id(value: T) = value
|
|
||||||
|
|
||||||
fun box(): String {
|
|
||||||
val value = builder {
|
|
||||||
try {
|
|
||||||
if (id(23) == 23) {
|
|
||||||
return@builder suspendAndLog("OK")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
finally {
|
|
||||||
result += "finally;"
|
|
||||||
}
|
|
||||||
result += "afterFinally;"
|
|
||||||
"shouldNotReach"
|
|
||||||
}
|
|
||||||
if (value != "suspend(OK);finally;return(OK);") return "fail: $value"
|
|
||||||
|
|
||||||
return "OK"
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
// TODO: muted automatically, investigate should it be ran for JS or not
|
|
||||||
// IGNORE_BACKEND: JS, NATIVE
|
|
||||||
|
|
||||||
// WITH_RUNTIME
|
|
||||||
|
|
||||||
fun box(): String =
|
|
||||||
listOf('O', 'K').fold("", String::plus)
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
// TODO: muted automatically, investigate should it be ran for JS or not
|
|
||||||
// IGNORE_BACKEND: JS, NATIVE
|
|
||||||
|
|
||||||
// WITH_RUNTIME
|
|
||||||
|
|
||||||
fun box(): String =
|
|
||||||
charArrayOf('O', 'K').fold("", String::plus)
|
|
||||||
-10
@@ -1,10 +0,0 @@
|
|||||||
// TODO: muted automatically, investigate should it be ran for JS or not
|
|
||||||
// IGNORE_BACKEND: JS, NATIVE
|
|
||||||
|
|
||||||
// WITH_REFLECT
|
|
||||||
|
|
||||||
fun doStuff(fn: String.() -> String) = "ok".fn()
|
|
||||||
|
|
||||||
fun box(): String {
|
|
||||||
return doStuff(String::toUpperCase)
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
// TODO: muted automatically, investigate should it be ran for JS or not
|
|
||||||
// IGNORE_BACKEND: JS, NATIVE
|
|
||||||
|
|
||||||
fun box(): String {
|
|
||||||
String()
|
|
||||||
return String() + "OK" + String()
|
|
||||||
}
|
|
||||||
-3
@@ -1,6 +1,3 @@
|
|||||||
// TODO: muted automatically, investigate should it be ran for JS or not
|
|
||||||
// IGNORE_BACKEND: JS, NATIVE
|
|
||||||
|
|
||||||
|
|
||||||
fun test(a: String, b: String): String {
|
fun test(a: String, b: String): String {
|
||||||
return a + b;
|
return a + b;
|
||||||
-3
@@ -1,6 +1,3 @@
|
|||||||
// TODO: muted automatically, investigate should it be ran for JS or not
|
|
||||||
// IGNORE_BACKEND: JS, NATIVE
|
|
||||||
|
|
||||||
fun box(): String {
|
fun box(): String {
|
||||||
var invokeOrder = "";
|
var invokeOrder = "";
|
||||||
val expectedResult = "0_1_9"
|
val expectedResult = "0_1_9"
|
||||||
+30
@@ -0,0 +1,30 @@
|
|||||||
|
fun box(): String {
|
||||||
|
var invokeOrder = "";
|
||||||
|
val expectedResult = "1_0_1_9"
|
||||||
|
val expectedInvokeOrder = "1_0_9"
|
||||||
|
var l = 1L
|
||||||
|
var i = 0
|
||||||
|
val captured = 9L
|
||||||
|
|
||||||
|
var result = 1.0.test(b = {invokeOrder += "1_"; l}(), a = {invokeOrder+="0_"; i}(), c = {invokeOrder += "$captured"; "$captured"})
|
||||||
|
if (invokeOrder != expectedInvokeOrder || result != expectedResult) return "fail 1: $invokeOrder != $expectedInvokeOrder or $result != $expectedResult"
|
||||||
|
|
||||||
|
invokeOrder = "";
|
||||||
|
result = 1.0.test(b = {invokeOrder += "1_"; l}(), c = {invokeOrder += "${captured}"; "${captured}"}, a = {invokeOrder+="0_"; i}())
|
||||||
|
if (invokeOrder != expectedInvokeOrder || result != expectedResult) return "fail 2: $invokeOrder != $expectedInvokeOrder or $result != $expectedResult"
|
||||||
|
|
||||||
|
|
||||||
|
invokeOrder = "";
|
||||||
|
result = 1.0.test(c = {invokeOrder += "${captured}"; "${captured}"}, b = {invokeOrder += "1_"; l}(), a = {invokeOrder+="0_"; i}())
|
||||||
|
if (invokeOrder != expectedInvokeOrder || result != expectedResult) return "fail 3: $invokeOrder != $expectedInvokeOrder or $result != $expectedResult"
|
||||||
|
|
||||||
|
invokeOrder = "";
|
||||||
|
result = 1.0.test(a = {invokeOrder+="0_"; i}(), c = {invokeOrder += "${captured}"; "${captured}"}, b = {invokeOrder += "1_"; l}())
|
||||||
|
if (invokeOrder != "0_1_9" || result != expectedResult) return "fail 4: $invokeOrder != 0_1_9 or $result != $expectedResult"
|
||||||
|
|
||||||
|
return "OK"
|
||||||
|
}
|
||||||
|
|
||||||
|
fun Double.test(a: Int, b: Long, c: () -> String): String {
|
||||||
|
return { "${this.toInt()}_${a}_${b}_${c()}"} ()
|
||||||
|
}
|
||||||
+2
-5
@@ -1,16 +1,13 @@
|
|||||||
// TODO: muted automatically, investigate should it be ran for JS or not
|
|
||||||
// IGNORE_BACKEND: JS, NATIVE
|
|
||||||
|
|
||||||
var invokeOrder: String = ""
|
var invokeOrder: String = ""
|
||||||
|
|
||||||
fun test(x: Double = { invokeOrder += "x"; 1.0 }(), a: String, y: Long = { invokeOrder += "y"; 1 }(), b: String): String {
|
fun test(x: Double = { invokeOrder += "x"; 1.0 }(), a: String, y: Long = { invokeOrder += "y"; 1 }(), b: String): String {
|
||||||
return "" + x + a + b + y;
|
return "" + x.toInt() + a + b + y;
|
||||||
}
|
}
|
||||||
|
|
||||||
fun box(): String {
|
fun box(): String {
|
||||||
val funResult = test(b = { invokeOrder += "K"; "K" }(), a = { invokeOrder += "O"; "O" }())
|
val funResult = test(b = { invokeOrder += "K"; "K" }(), a = { invokeOrder += "O"; "O" }())
|
||||||
|
|
||||||
if (invokeOrder != "KOxy" || funResult != "1.0OK1") return "fail: $invokeOrder != KOxy or $funResult != 1.0OK1"
|
if (invokeOrder != "KOxy" || funResult != "1OK1") return "fail: $invokeOrder != KOxy or $funResult != 1OK1"
|
||||||
|
|
||||||
return "OK"
|
return "OK"
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
fun box(): String {
|
||||||
|
var invokeOrder = "";
|
||||||
|
val expectedResult = "1_0_1_L"
|
||||||
|
val expectedInvokeOrder = "1_0_L"
|
||||||
|
var l = 1L
|
||||||
|
var i = 0
|
||||||
|
|
||||||
|
var result = 1.0.test(b = {invokeOrder += "1_"; l}(), a = {invokeOrder+="0_"; i}(), c = {invokeOrder += "L"; "L"})
|
||||||
|
if (invokeOrder != expectedInvokeOrder || result != expectedResult) return "fail 1: $invokeOrder != $expectedInvokeOrder or $result != $expectedResult"
|
||||||
|
|
||||||
|
invokeOrder = "";
|
||||||
|
result = 1.0.test(b = {invokeOrder += "1_"; l}(), c = {invokeOrder += "L"; "L"}, a = {invokeOrder+="0_"; i}())
|
||||||
|
if (invokeOrder != expectedInvokeOrder || result != expectedResult) return "fail 2: $invokeOrder != $expectedInvokeOrder or $result != $expectedResult"
|
||||||
|
|
||||||
|
|
||||||
|
invokeOrder = "";
|
||||||
|
result = 1.0.test(c = {invokeOrder += "L"; "L"}, b = {invokeOrder += "1_"; l}(), a = {invokeOrder+="0_"; i}())
|
||||||
|
if (invokeOrder != expectedInvokeOrder || result != expectedResult) return "fail 3: $invokeOrder != $expectedInvokeOrder or $result != $expectedResult"
|
||||||
|
|
||||||
|
|
||||||
|
invokeOrder = "";
|
||||||
|
result = 1.0.test(a = {invokeOrder+="0_"; i}(), c = {invokeOrder += "L"; "L"}, b = {invokeOrder += "1_"; l}())
|
||||||
|
if (invokeOrder != "0_1_L" || result != expectedResult) return "fail 4: $invokeOrder != 0_1_L or $result != $expectedResult"
|
||||||
|
|
||||||
|
return "OK"
|
||||||
|
}
|
||||||
|
|
||||||
|
fun Double.test(a: Int, b: Long, c: () -> String): String {
|
||||||
|
return "${this.toInt()}_${a}_${b}_${c()}"
|
||||||
|
}
|
||||||
+2
-5
@@ -1,19 +1,16 @@
|
|||||||
// TODO: muted automatically, investigate should it be ran for JS or not
|
|
||||||
// IGNORE_BACKEND: JS, NATIVE
|
|
||||||
|
|
||||||
fun box(): String {
|
fun box(): String {
|
||||||
return Z().test()
|
return Z().test()
|
||||||
}
|
}
|
||||||
|
|
||||||
class Z {
|
class Z {
|
||||||
fun Double.test(a: Int, b: Long, c: () -> String): String {
|
fun Double.test(a: Int, b: Long, c: () -> String): String {
|
||||||
return "${this}_${a}_${b}_${c()}"
|
return "${this.toInt()}_${a}_${b}_${c()}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
fun test(): String {
|
fun test(): String {
|
||||||
var invokeOrder = "";
|
var invokeOrder = "";
|
||||||
val expectedResult = "1.0_0_1_L"
|
val expectedResult = "1_0_1_L"
|
||||||
val expectedInvokeOrder = "1_0_L"
|
val expectedInvokeOrder = "1_0_L"
|
||||||
var l = 1L
|
var l = 1L
|
||||||
var i = 0
|
var i = 0
|
||||||
-3
@@ -1,6 +1,3 @@
|
|||||||
// TODO: muted automatically, investigate should it be ran for JS or not
|
|
||||||
// IGNORE_BACKEND: JS, NATIVE
|
|
||||||
|
|
||||||
fun box(): String {
|
fun box(): String {
|
||||||
var res = "";
|
var res = "";
|
||||||
var call = test(b = {res += "K"; "K"}(), a = {res+="O"; "O"}(), c = {res += "L"; "L"})
|
var call = test(b = {res += "K"; "K"}(), a = {res+="O"; "O"}(), c = {res += "L"; "L"})
|
||||||
-3
@@ -1,6 +1,3 @@
|
|||||||
// TODO: muted automatically, investigate should it be ran for JS or not
|
|
||||||
// IGNORE_BACKEND: JS, NATIVE
|
|
||||||
|
|
||||||
fun box(): String {
|
fun box(): String {
|
||||||
var res = "";
|
var res = "";
|
||||||
var call = Z("Z").test(b = {res += "K"; "K"}(), a = {res+="O"; "O"}(), c = {res += "L"; "L"})
|
var call = Z("Z").test(b = {res += "K"; "K"}(), a = {res+="O"; "O"}(), c = {res += "L"; "L"})
|
||||||
+1
-1
@@ -23,4 +23,4 @@ fun box(): String {
|
|||||||
assertEquals("2", sa[2])
|
assertEquals("2", sa[2])
|
||||||
|
|
||||||
return "OK"
|
return "OK"
|
||||||
}
|
}
|
||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
// TODO: muted automatically, investigate should it be ran for JS or not
|
// TODO: muted automatically, investigate should it be ran for JS or not
|
||||||
// IGNORE_BACKEND: JS, NATIVE
|
// IGNORE_BACKEND: JS
|
||||||
|
|
||||||
//test [], get and iterator calls
|
//test [], get and iterator calls
|
||||||
fun test(createIntNotLong: Boolean): String {
|
fun test(createIntNotLong: Boolean): String {
|
||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
// TODO: muted automatically, investigate should it be ran for JS or not
|
// TODO: muted automatically, investigate should it be ran for JS or not
|
||||||
// IGNORE_BACKEND: JS, NATIVE
|
// IGNORE_BACKEND: JS
|
||||||
|
|
||||||
fun foo(x: Cloneable) = x
|
fun foo(x: Cloneable) = x
|
||||||
|
|
||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
// TODO: muted automatically, investigate should it be ran for JS or not
|
// TODO: muted automatically, investigate should it be ran for JS or not
|
||||||
// IGNORE_BACKEND: JS, NATIVE
|
// IGNORE_BACKEND: JS
|
||||||
|
|
||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
|
|
||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
// TODO: muted automatically, investigate should it be ran for JS or not
|
// TODO: muted automatically, investigate should it be ran for JS or not
|
||||||
// IGNORE_BACKEND: JS, NATIVE
|
// IGNORE_BACKEND: JS
|
||||||
|
|
||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
|
|
||||||
+14
@@ -0,0 +1,14 @@
|
|||||||
|
// WITH_RUNTIME
|
||||||
|
abstract class Table<T>(
|
||||||
|
val content: Array<Array<T>>
|
||||||
|
)
|
||||||
|
|
||||||
|
fun box(): String {
|
||||||
|
val x = object : Table<String>(
|
||||||
|
Array(1, {
|
||||||
|
x-> Array(1, {y -> "OK"})
|
||||||
|
})
|
||||||
|
) {}
|
||||||
|
|
||||||
|
return x.content[0][0]
|
||||||
|
}
|
||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
// TODO: muted automatically, investigate should it be ran for JS or not
|
// TODO: muted automatically, investigate should it be ran for JS or not
|
||||||
// IGNORE_BACKEND: JS, NATIVE
|
// IGNORE_BACKEND: JS
|
||||||
|
|
||||||
fun box(): String {
|
fun box(): String {
|
||||||
val a = ByteArray(5)
|
val a = ByteArray(5)
|
||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
// TODO: muted automatically, investigate should it be ran for JS or not
|
// TODO: muted automatically, investigate should it be ran for JS or not
|
||||||
// IGNORE_BACKEND: JS, NATIVE
|
// IGNORE_BACKEND: JS
|
||||||
|
|
||||||
fun box(): String {
|
fun box(): String {
|
||||||
val a = LongArray(5)
|
val a = LongArray(5)
|
||||||
+2
@@ -1,4 +1,6 @@
|
|||||||
//KT-2997 Automatically cast error (Array)
|
//KT-2997 Automatically cast error (Array)
|
||||||
|
// IGNORE_BACKEND: JS
|
||||||
|
// Unmute when JS implements primitive arrays via TypeArray
|
||||||
|
|
||||||
fun foo(a: Any): Int {
|
fun foo(a: Any): Int {
|
||||||
if (a is IntArray) {
|
if (a is IntArray) {
|
||||||
+1
-1
@@ -5,7 +5,7 @@ operator fun String.get(vararg value: Any) : String {
|
|||||||
operator fun Int.get(vararg value: Any) : Int {
|
operator fun Int.get(vararg value: Any) : Int {
|
||||||
return if (value[0] == 44 && value[1] == "example") 1 else 0
|
return if (value[0] == 44 && value[1] == "example") 1 else 0
|
||||||
}
|
}
|
||||||
fun foo(args: Array<String>) {
|
fun main(args: Array<String>) {
|
||||||
12 [44, "example"]
|
12 [44, "example"]
|
||||||
}
|
}
|
||||||
|
|
||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
// TODO: muted automatically, investigate should it be ran for JS or not
|
// TODO: muted automatically, investigate should it be ran for JS or not
|
||||||
// IGNORE_BACKEND: JS, NATIVE
|
// IGNORE_BACKEND: JS
|
||||||
|
|
||||||
fun iarr(vararg a : Int) = a
|
fun iarr(vararg a : Int) = a
|
||||||
fun <T> array(vararg a : T) = a
|
fun <T> array(vararg a : T) = a
|
||||||
-3
@@ -1,6 +1,3 @@
|
|||||||
// TODO: muted automatically, investigate should it be ran for JS or not
|
|
||||||
// IGNORE_BACKEND: JS, NATIVE
|
|
||||||
|
|
||||||
fun test(b: Boolean): String {
|
fun test(b: Boolean): String {
|
||||||
val a = if (b) IntArray(5) else LongArray(5)
|
val a = if (b) IntArray(5) else LongArray(5)
|
||||||
if (a is IntArray) {
|
if (a is IntArray) {
|
||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
// TODO: muted automatically, investigate should it be ran for JS or not
|
// TODO: muted automatically, investigate should it be ran for JS or not
|
||||||
// IGNORE_BACKEND: JS, NATIVE
|
// IGNORE_BACKEND: JS
|
||||||
|
|
||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user