JS: make some JVM tests compatible with JS BE

This commit is contained in:
Alexey Andreev
2016-12-30 15:09:08 +03:00
parent 70176dfacc
commit bad6f41d6e
5 changed files with 12 additions and 48 deletions
+2 -5
View File
@@ -1,16 +1,13 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
var invokeOrder: 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 {
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"
}