JS: verified that String concatenation with large Long's is fixed (KT-8666)
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
val MAX_LONG = "9223372036854775807"
|
||||
val PREFIX = "max = "
|
||||
|
||||
fun box(): String {
|
||||
if (MAX_LONG != "${Long.MAX_VALUE}") return "fail template"
|
||||
if (MAX_LONG != "" + Long.MAX_VALUE) return "fail \"\" +"
|
||||
if (MAX_LONG != "".plus(Long.MAX_VALUE)) return "fail \"\".plus"
|
||||
if (MAX_LONG != (String::plus)("", Long.MAX_VALUE)) return "fail String::plus"
|
||||
if (MAX_LONG != (""::plus)(Long.MAX_VALUE)) return "fail \"\"::plus"
|
||||
|
||||
if (PREFIX + MAX_LONG != "max = ${Long.MAX_VALUE}") return "fail template with prefix"
|
||||
if (PREFIX + MAX_LONG != PREFIX + Long.MAX_VALUE) return "fail \"$PREFIX\" +"
|
||||
if (PREFIX + MAX_LONG != PREFIX.plus(Long.MAX_VALUE)) return "fail \"$PREFIX\".plus"
|
||||
if (PREFIX + MAX_LONG != (String::plus)(PREFIX, Long.MAX_VALUE)) return "fail String::plus($PREFIX, ...)"
|
||||
if (PREFIX + MAX_LONG != (PREFIX::plus)(Long.MAX_VALUE)) return "fail \"$PREFIX\"::plus"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
+6
@@ -8939,6 +8939,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt8666.kt")
|
||||
public void testKt8666() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/intrinsics/kt8666.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("longRangeWithExplicitDot.kt")
|
||||
public void testLongRangeWithExplicitDot() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/intrinsics/longRangeWithExplicitDot.kt");
|
||||
|
||||
@@ -8939,6 +8939,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt8666.kt")
|
||||
public void testKt8666() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/intrinsics/kt8666.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("longRangeWithExplicitDot.kt")
|
||||
public void testLongRangeWithExplicitDot() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/intrinsics/longRangeWithExplicitDot.kt");
|
||||
|
||||
@@ -8939,6 +8939,12 @@ public class LightAnalysisModeCodegenTestGenerated extends AbstractLightAnalysis
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt8666.kt")
|
||||
public void testKt8666() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/intrinsics/kt8666.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("longRangeWithExplicitDot.kt")
|
||||
public void testLongRangeWithExplicitDot() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/intrinsics/longRangeWithExplicitDot.kt");
|
||||
|
||||
@@ -10002,6 +10002,12 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that.");
|
||||
}
|
||||
|
||||
@TestMetadata("kt8666.kt")
|
||||
public void testKt8666() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/intrinsics/kt8666.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("longRangeWithExplicitDot.kt")
|
||||
public void testLongRangeWithExplicitDot() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/intrinsics/longRangeWithExplicitDot.kt");
|
||||
|
||||
Reference in New Issue
Block a user