JS: make some JVM tests compatible with JS BE
This commit is contained in:
@@ -1,9 +1,6 @@
|
|||||||
// TODO: muted automatically, investigate should it be ran for JS or not
|
|
||||||
// IGNORE_BACKEND: JS
|
|
||||||
|
|
||||||
fun box(): String {
|
fun box(): String {
|
||||||
var invokeOrder = "";
|
var invokeOrder = "";
|
||||||
val expectedResult = "1.0_0_1_9"
|
val expectedResult = "1_0_1_9"
|
||||||
val expectedInvokeOrder = "1_0_9"
|
val expectedInvokeOrder = "1_0_9"
|
||||||
var l = 1L
|
var l = 1L
|
||||||
var i = 0
|
var i = 0
|
||||||
@@ -29,5 +26,5 @@ fun box(): String {
|
|||||||
}
|
}
|
||||||
|
|
||||||
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()}"} ()
|
||||||
}
|
}
|
||||||
+2
-5
@@ -1,16 +1,13 @@
|
|||||||
// TODO: muted automatically, investigate should it be ran for JS or not
|
|
||||||
// IGNORE_BACKEND: JS
|
|
||||||
|
|
||||||
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"
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,6 @@
|
|||||||
// TODO: muted automatically, investigate should it be ran for JS or not
|
|
||||||
// IGNORE_BACKEND: JS
|
|
||||||
|
|
||||||
fun box(): String {
|
fun box(): 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
|
||||||
@@ -29,5 +26,5 @@ fun box(): String {
|
|||||||
}
|
}
|
||||||
|
|
||||||
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()}"
|
||||||
}
|
}
|
||||||
@@ -1,19 +1,16 @@
|
|||||||
// TODO: muted automatically, investigate should it be ran for JS or not
|
|
||||||
// IGNORE_BACKEND: JS
|
|
||||||
|
|
||||||
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
|
||||||
|
|||||||
+4
-28
@@ -335,49 +335,25 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
|||||||
@TestMetadata("capturedInExtension.kt")
|
@TestMetadata("capturedInExtension.kt")
|
||||||
public void testCapturedInExtension() throws Exception {
|
public void testCapturedInExtension() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/argumentOrder/capturedInExtension.kt");
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/argumentOrder/capturedInExtension.kt");
|
||||||
try {
|
doTest(fileName);
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
catch (Throwable ignore) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("defaults.kt")
|
@TestMetadata("defaults.kt")
|
||||||
public void testDefaults() throws Exception {
|
public void testDefaults() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/argumentOrder/defaults.kt");
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/argumentOrder/defaults.kt");
|
||||||
try {
|
doTest(fileName);
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
catch (Throwable ignore) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("extension.kt")
|
@TestMetadata("extension.kt")
|
||||||
public void testExtension() throws Exception {
|
public void testExtension() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/argumentOrder/extension.kt");
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/argumentOrder/extension.kt");
|
||||||
try {
|
doTest(fileName);
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
catch (Throwable ignore) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("extensionInClass.kt")
|
@TestMetadata("extensionInClass.kt")
|
||||||
public void testExtensionInClass() throws Exception {
|
public void testExtensionInClass() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/argumentOrder/extensionInClass.kt");
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/argumentOrder/extensionInClass.kt");
|
||||||
try {
|
doTest(fileName);
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
catch (Throwable ignore) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("kt9277.kt")
|
@TestMetadata("kt9277.kt")
|
||||||
|
|||||||
Reference in New Issue
Block a user