From 8b5607d98f95caf1f31af112bbdab689198590cb Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Tue, 22 Jan 2013 19:35:56 +0400 Subject: [PATCH] Regression tests for some old EA reports EA-35953, EA-35743 --- compiler/testData/codegen/intrinsics/ea35953.kt | 6 ++++++ compiler/testData/codegen/regressions/ea35743.kt | 6 ++++++ compiler/tests/org/jetbrains/jet/codegen/StringsTest.java | 4 ++++ .../jet/codegen/generated/IntrinsicsTestGenerated.java | 7 ++++++- 4 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 compiler/testData/codegen/intrinsics/ea35953.kt create mode 100644 compiler/testData/codegen/regressions/ea35743.kt diff --git a/compiler/testData/codegen/intrinsics/ea35953.kt b/compiler/testData/codegen/intrinsics/ea35953.kt new file mode 100644 index 00000000000..122782f4faf --- /dev/null +++ b/compiler/testData/codegen/intrinsics/ea35953.kt @@ -0,0 +1,6 @@ +fun box(): String { + if (12.toString() equals "13") { + return "Fail" + } + return "OK" +} diff --git a/compiler/testData/codegen/regressions/ea35743.kt b/compiler/testData/codegen/regressions/ea35743.kt new file mode 100644 index 00000000000..23832223923 --- /dev/null +++ b/compiler/testData/codegen/regressions/ea35743.kt @@ -0,0 +1,6 @@ +val Int.test = "test" + +fun box(): String { + val x = "a ${1.test}" + return if (x == "a test") "OK" else "Fail $x" +} diff --git a/compiler/tests/org/jetbrains/jet/codegen/StringsTest.java b/compiler/tests/org/jetbrains/jet/codegen/StringsTest.java index a8f76143fc6..e2f95b305f2 100644 --- a/compiler/tests/org/jetbrains/jet/codegen/StringsTest.java +++ b/compiler/tests/org/jetbrains/jet/codegen/StringsTest.java @@ -88,4 +88,8 @@ public class StringsTest extends CodegenTestCase { public void testKt889() throws Exception { blackBoxFile("regressions/kt889.jet"); } + + public void testEa35743() { + blackBoxFile("regressions/ea35743.kt"); + } } diff --git a/compiler/tests/org/jetbrains/jet/codegen/generated/IntrinsicsTestGenerated.java b/compiler/tests/org/jetbrains/jet/codegen/generated/IntrinsicsTestGenerated.java index 9000a690998..82b077a998a 100644 --- a/compiler/tests/org/jetbrains/jet/codegen/generated/IntrinsicsTestGenerated.java +++ b/compiler/tests/org/jetbrains/jet/codegen/generated/IntrinsicsTestGenerated.java @@ -33,12 +33,17 @@ public class IntrinsicsTestGenerated extends AbstractCodegenTest { public void testAllFilesPresentInIntrinsics() throws Exception { JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/codegen/intrinsics"), "kt", true); } - + @TestMetadata("compareTo.kt") public void testCompareTo() throws Exception { blackBoxFileByFullPath("compiler/testData/codegen/intrinsics/compareTo.kt"); } + @TestMetadata("ea35953.kt") + public void testEa35953() throws Exception { + blackBoxFileByFullPath("compiler/testData/codegen/intrinsics/ea35953.kt"); + } + @TestMetadata("longRangeWithExplicitDot.kt") public void testLongRangeWithExplicitDot() throws Exception { blackBoxFileByFullPath("compiler/testData/codegen/intrinsics/longRangeWithExplicitDot.kt");