From 21c37951d684f99ab3810fb2125a8e5f0ebe0f37 Mon Sep 17 00:00:00 2001 From: Evgeny Gerashchenko Date: Wed, 30 Jan 2013 16:03:22 +0400 Subject: [PATCH] Removed old range test which were spread all over the place. --- .../codegen/box/primitiveTypes/emptyRanges.kt | 24 ----- .../codegen/box/primitiveTypes/kt821.kt | 24 ----- .../codegen/box/primitiveTypes/kt944.kt | 8 -- .../testData/codegen/box/ranges/kt2596.kt | 7 -- .../testData/codegen/regressions/kt1076.kt | 11 -- .../testData/codegen/regressions/kt765.kt | 13 --- .../testData/codegen/regressions/kt925.kt | 54 ---------- .../testData/codegen/regressions/kt930.kt | 100 ------------------ compiler/testData/codegen/uptoDownto.kt | 38 ------- .../org/jetbrains/jet/codegen/StdlibTest.java | 20 ---- .../BlackBoxCodegenTestGenerated.java | 32 +----- 11 files changed, 2 insertions(+), 329 deletions(-) delete mode 100644 compiler/testData/codegen/box/primitiveTypes/emptyRanges.kt delete mode 100644 compiler/testData/codegen/box/primitiveTypes/kt821.kt delete mode 100644 compiler/testData/codegen/box/primitiveTypes/kt944.kt delete mode 100644 compiler/testData/codegen/box/ranges/kt2596.kt delete mode 100644 compiler/testData/codegen/regressions/kt1076.kt delete mode 100644 compiler/testData/codegen/regressions/kt765.kt delete mode 100644 compiler/testData/codegen/regressions/kt925.kt delete mode 100644 compiler/testData/codegen/regressions/kt930.kt delete mode 100644 compiler/testData/codegen/uptoDownto.kt diff --git a/compiler/testData/codegen/box/primitiveTypes/emptyRanges.kt b/compiler/testData/codegen/box/primitiveTypes/emptyRanges.kt deleted file mode 100644 index 417f8306b31..00000000000 --- a/compiler/testData/codegen/box/primitiveTypes/emptyRanges.kt +++ /dev/null @@ -1,24 +0,0 @@ -fun box(): String { - if (IntRange(1, 0) != IntRange.EMPTY) { - return IntRange.EMPTY.toString() - } - if (CharRange(1.toChar(), 0.toChar()) != CharRange.EMPTY) { - return CharRange.EMPTY.toString() - } - if (ByteRange(1, 0) != ByteRange.EMPTY) { - return ByteRange.EMPTY.toString() - } - if (ShortRange(1, 0) != ShortRange.EMPTY) { - return ShortRange.EMPTY.toString() - } - if (FloatRange(1.toFloat(), 0.toFloat()) != FloatRange.EMPTY) { - return FloatRange.EMPTY.toString() - } - if (LongRange(1, 0) != LongRange.EMPTY) { - return LongRange.EMPTY.toString() - } - if (DoubleRange(1.0, 0.0) != DoubleRange.EMPTY) { - return DoubleRange.EMPTY.toString() - } - return "OK" -} diff --git a/compiler/testData/codegen/box/primitiveTypes/kt821.kt b/compiler/testData/codegen/box/primitiveTypes/kt821.kt deleted file mode 100644 index 8c08642267d..00000000000 --- a/compiler/testData/codegen/box/primitiveTypes/kt821.kt +++ /dev/null @@ -1,24 +0,0 @@ -fun box() : String { - val r1 = IntRange(1, 4) - if(r1.start != 1 || r1.end != 4) return "fail" - - val r2 = ByteRange(1, 4) - if(r2.start != 1.toByte() || r2.end != 4.toByte()) return "fail" - - val r3 = ShortRange(1, 4) - if(r3.start != 1.toShort() || r3.end != 4.toShort()) return "fail" - - val r4 = CharRange('a', 'd') - if(r4.start != 'a' || r4.end != 'd') return "fail" - - val r5 = FloatRange(0.0.toFloat(), 1.0.toFloat()) - if(r5.start != 0.0.toFloat() || r5.end != 1.0.toFloat()) return "fail" - - val r6 = DoubleRange(0.0, 1.0) - if(r6.start != 0.0 || r6.end != 1.0) return "fail" - - val r7 = LongRange(1, 4) - if(r7.start != 1.toLong() || r7.end != 4.toLong()) return "fail" - - return "OK" -} diff --git a/compiler/testData/codegen/box/primitiveTypes/kt944.kt b/compiler/testData/codegen/box/primitiveTypes/kt944.kt deleted file mode 100644 index f23ae3a2d5b..00000000000 --- a/compiler/testData/codegen/box/primitiveTypes/kt944.kt +++ /dev/null @@ -1,8 +0,0 @@ -fun box() : String { - for (i in "".indices) { - ""[i] - } - return "OK" -} - -val String?.indices : IntRange get() = 0..(this!!.length - 1) \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/kt2596.kt b/compiler/testData/codegen/box/ranges/kt2596.kt deleted file mode 100644 index e5311df8a4e..00000000000 --- a/compiler/testData/codegen/box/ranges/kt2596.kt +++ /dev/null @@ -1,7 +0,0 @@ -fun box(): String { - val iterator: Iterator = (0..0).iterator() - for (i in iterator) { - return "OK" - } - return "fail" -} \ No newline at end of file diff --git a/compiler/testData/codegen/regressions/kt1076.kt b/compiler/testData/codegen/regressions/kt1076.kt deleted file mode 100644 index 181ab012e4f..00000000000 --- a/compiler/testData/codegen/regressions/kt1076.kt +++ /dev/null @@ -1,11 +0,0 @@ -fun box() : String { - var cnt = 0 - for (len in 4 downTo 1) { - cnt++ - } - - for (n in (1..5).reversed()) - cnt++ - - return if(cnt == 9) "OK" else cnt.toString() -} diff --git a/compiler/testData/codegen/regressions/kt765.kt b/compiler/testData/codegen/regressions/kt765.kt deleted file mode 100644 index 48c77a6439c..00000000000 --- a/compiler/testData/codegen/regressions/kt765.kt +++ /dev/null @@ -1,13 +0,0 @@ -fun box() : String { - System.out?.println(System.out?.println(10.toFloat()..11.toFloat())) - - for(f in 10.toFloat()..11.toFloat() step 0.3.toFloat()) { - System.out?.println(f) - } - - for(f in 10.toDouble()..11.toDouble() step 0.3.toDouble()) { - System.out?.println(f) - } - - return "OK" -} diff --git a/compiler/testData/codegen/regressions/kt925.kt b/compiler/testData/codegen/regressions/kt925.kt deleted file mode 100644 index 84e9ee305c6..00000000000 --- a/compiler/testData/codegen/regressions/kt925.kt +++ /dev/null @@ -1,54 +0,0 @@ -fun test1() : Boolean { - val r1 = 1..10 - var s1 = 0 - for(e in r1 step 2) { - s1 += e - } - return s1 == 25 -} - -fun test2() : Boolean { - val r1 = 1.toByte()..10.toByte() - var s1 = 0 - for(e in r1 step 2) { - s1 += e - } - return s1 == 25 -} - -fun test3() : Boolean { - val r1 = 1.toByte()..10.toLong() - var s1 = 0.toLong() - for(e in r1 step 2) { - s1 += e - } - return s1 == 25.toLong() -} - -fun test4() : Boolean { - val r1 = 1.toByte()..10.toShort() - var s1 = 0.toShort() - for(e in r1 step 2) { - s1 += e - } - return s1 == 25.toShort() -} - -fun test5() : Boolean { - val r1 = 'a'..'h' - var s1 = 0 - for(e in r1 step 2) { - s1 ++ - } - return s1 == 4 -} - -fun box() : String { - if(test1().not()) return "test1 failed" - if(test2().not()) return "test2 failed" - if(test3().not()) return "test3 failed" - if(test4().not()) return "test4 failed" - if(test5().not()) return "test4 failed" - - return "OK" -} diff --git a/compiler/testData/codegen/regressions/kt930.kt b/compiler/testData/codegen/regressions/kt930.kt deleted file mode 100644 index d080a19ba73..00000000000 --- a/compiler/testData/codegen/regressions/kt930.kt +++ /dev/null @@ -1,100 +0,0 @@ -fun testInt () : String { - val r1 = 1 rangeTo 4 - if (r1.start != 1 || r1.end != 4) return "int rangeTo fail" - - val r2 = 4 rangeTo 1 - if (r2.start != 4 || r2.end != 1) return "int negative rangeTo fail" - - val r3 = 5 downTo 0 - if (r3.start != 5 || r3.end != 0 || r3.increment != -1) return "int downTo fail" - - val r4 = 5 downTo 6 - if (r4.start != 5 || r4.end != 6 || r4.increment != -1) return "int negative downTo fail" - - return "OK" -} - -fun testByte () : String { - val r1 = 1.toByte() rangeTo 4.toByte() - if (r1.start != 1.toByte() || r1.end != 4.toByte()) return "byte rangeTo fail" - - val r2 = 4.toByte() rangeTo 1.toByte() - if (r2.start != 4.toByte() || r2.end != 1.toByte()) return "byte negative rangeTo fail" - - val r3 = 5.toByte() downTo 0.toByte() - if (r3.start != 5.toByte() || r3.end != 0.toByte() || r3.increment != -1) return "byte downTo fail" - - val r4 = 5.toByte() downTo 6.toByte() - if (r3.start != 5.toByte() || r3.end != 0.toByte() || r4.increment != -1) return "byte negative downTo fail" - - return "OK" -} - -fun testShort () : String { - - val r1 = 1.toShort() rangeTo 4.toShort() - if (r1.start != 1.toShort() || r1.end != 4.toShort()) return "short rangeTo fail" - - val r2 = 4.toShort() rangeTo 1.toShort() - if (r2.start != 4.toShort() || r2.end != 1.toShort()) return "short negative rangeTo fail" - - val r3 = 5.toShort() downTo 0.toShort() - if (r3.start != 5.toShort() || r3.end != 0.toShort() || r3.increment != -1) return "short downTo fail" - - val r4 = 5.toShort() downTo 6.toShort() - if (r3.start != 5.toShort() || r3.end != 0.toShort() || r4.increment != -1) return "short negative downTo fail" - - return "OK" -} - -fun testLong () : String { - - val r1 = 1.toLong() rangeTo 4.toLong() - if (r1.start != 1.toLong() || r1.end != 4.toLong()) return "long rangeTo fail" - - val r2 = 4.toLong() rangeTo 1.toLong() - if (r2.start != 4.toLong() || r2.end != 1.toLong()) return "long negative rangeTo fail" - - val r3 = 5.toLong() downTo 0.toLong() - if (r3.start != 5.toLong() || r3.end != 0.toLong() || r3.increment != -1.toLong()) return "long downTo fail" - - val r4 = 5.toLong() downTo 6.toLong() - if (r3.start != 5.toLong() || r3.end != 0.toLong() || r4.increment != -1.toLong()) return "long negative downTo fail" - - return "OK" -} - -fun testChar () : String { - - val r1 = 'a' rangeTo 'd' - if (r1.start != 'a' || r1.end != 'd') return "char rangeTo fail" - - val r2 = 'd' rangeTo 'a' - if(r2.start != 'd' || r2.end != 'a') return "char negative long fail" - - val r3 = 'd' downTo 'a' - if (r3.start != 'd' || r3.end != 'a' || r3.increment != -1) return "char downTo fail" - - val r4 = 'a' downTo 'd' - if (r4.start != 'a' || r4.end != 'd' || r4.increment != -1) return "char negative downTo fail" - - return "OK" -} - -fun box() : String { - var r : String - - r = testInt() - if(r != "OK") return r - - r = testByte() - if(r != "OK") return r - - r = testShort() - if(r != "OK") return r - - r = testLong() - if(r != "OK") return r - - return "OK" -} \ No newline at end of file diff --git a/compiler/testData/codegen/uptoDownto.kt b/compiler/testData/codegen/uptoDownto.kt deleted file mode 100644 index 5ce07448865..00000000000 --- a/compiler/testData/codegen/uptoDownto.kt +++ /dev/null @@ -1,38 +0,0 @@ -fun box(): String { - val sb = StringBuilder() - - fun ap(i : Int) { - if (sb.size != 0) sb.append(" ") - sb.append(i) - } - - for (i in 0..0) { - ap(i) - } - sb.append(";") - - for (i in 0..1) { - ap(i) - } - sb.append(";") - - for (i in IntRange(0, 0)) { - ap(i) - } - sb.append(";") - - for (i in 0 downTo 0) { - ap(i) - } - sb.append(";") - - for (i in 1 downTo 0) { - ap(i) - } - - return if (sb.toString() == "0; 0 1; 0; 0; 1 0") "OK" else sb.toString()!! -} - -fun main(args: Array) { - println(box()) -} \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/jet/codegen/StdlibTest.java b/compiler/tests/org/jetbrains/jet/codegen/StdlibTest.java index 927e6bbdfcd..e771a8e9eb5 100644 --- a/compiler/tests/org/jetbrains/jet/codegen/StdlibTest.java +++ b/compiler/tests/org/jetbrains/jet/codegen/StdlibTest.java @@ -316,22 +316,6 @@ public class StdlibTest extends CodegenTestCase { blackBoxFile("regressions/kt2334.kt"); } - public void testUptoDownto() { - blackBoxFile("uptoDownto.kt"); - } - - public void testKt765 () { - blackBoxFile("regressions/kt765.kt"); - } - - public void testKt925 () { - blackBoxFile("regressions/kt925.kt"); - } - - public void testKt930 () { - blackBoxFile("regressions/kt930.kt"); - } - public void test1733() { blackBoxFile("regressions/kt1733.kt"); } @@ -364,10 +348,6 @@ public class StdlibTest extends CodegenTestCase { blackBoxFile("jdk-annotations/collections.kt"); } - public void testKt1076() { - blackBoxFile("regressions/kt1076.kt"); - } - public void testKt1515() { blackBoxMultiFile("/multi/kt1515/thisPackage.kt", "/multi/kt1515/otherPackage.kt"); } diff --git a/compiler/tests/org/jetbrains/jet/codegen/generated/BlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/jet/codegen/generated/BlackBoxCodegenTestGenerated.java index acf68daad19..e1d4f744868 100644 --- a/compiler/tests/org/jetbrains/jet/codegen/generated/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/jet/codegen/generated/BlackBoxCodegenTestGenerated.java @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.jetbrains.jet.codegen.generated; import junit.framework.Assert; @@ -29,7 +30,7 @@ import org.jetbrains.jet.codegen.generated.AbstractBlackBoxCodegenTest; /** This class is generated by {@link org.jetbrains.jet.generators.tests.GenerateTests}. DO NOT MODIFY MANUALLY */ @SuppressWarnings("all") @TestMetadata("compiler/testData/codegen/box") -@InnerTestClasses({BlackBoxCodegenTestGenerated.Arrays.class, BlackBoxCodegenTestGenerated.Bridges.class, BlackBoxCodegenTestGenerated.Casts.class, BlackBoxCodegenTestGenerated.Classes.class, BlackBoxCodegenTestGenerated.Closures.class, BlackBoxCodegenTestGenerated.ControlStructures.class, BlackBoxCodegenTestGenerated.DefaultArguments.class, BlackBoxCodegenTestGenerated.Enum.class, BlackBoxCodegenTestGenerated.ExtensionFunctions.class, BlackBoxCodegenTestGenerated.ExtensionProperties.class, BlackBoxCodegenTestGenerated.Functions.class, BlackBoxCodegenTestGenerated.InnerNested.class, BlackBoxCodegenTestGenerated.Instructions.class, BlackBoxCodegenTestGenerated.Intrinsics.class, BlackBoxCodegenTestGenerated.Labels.class, BlackBoxCodegenTestGenerated.LocalClasses.class, BlackBoxCodegenTestGenerated.MultiDecl.class, BlackBoxCodegenTestGenerated.Namespace.class, BlackBoxCodegenTestGenerated.Objects.class, BlackBoxCodegenTestGenerated.OperatorConventions.class, BlackBoxCodegenTestGenerated.PrimitiveTypes.class, BlackBoxCodegenTestGenerated.Properties.class, BlackBoxCodegenTestGenerated.Ranges.class, BlackBoxCodegenTestGenerated.SafeCall.class, BlackBoxCodegenTestGenerated.Strings.class, BlackBoxCodegenTestGenerated.Super.class, BlackBoxCodegenTestGenerated.Traits.class, BlackBoxCodegenTestGenerated.TypeInfo.class, BlackBoxCodegenTestGenerated.Unit.class, BlackBoxCodegenTestGenerated.Vararg.class, BlackBoxCodegenTestGenerated.When.class}) +@InnerTestClasses({BlackBoxCodegenTestGenerated.Arrays.class, BlackBoxCodegenTestGenerated.Bridges.class, BlackBoxCodegenTestGenerated.Casts.class, BlackBoxCodegenTestGenerated.Classes.class, BlackBoxCodegenTestGenerated.Closures.class, BlackBoxCodegenTestGenerated.ControlStructures.class, BlackBoxCodegenTestGenerated.DefaultArguments.class, BlackBoxCodegenTestGenerated.Enum.class, BlackBoxCodegenTestGenerated.ExtensionFunctions.class, BlackBoxCodegenTestGenerated.ExtensionProperties.class, BlackBoxCodegenTestGenerated.Functions.class, BlackBoxCodegenTestGenerated.InnerNested.class, BlackBoxCodegenTestGenerated.Instructions.class, BlackBoxCodegenTestGenerated.Intrinsics.class, BlackBoxCodegenTestGenerated.Labels.class, BlackBoxCodegenTestGenerated.LocalClasses.class, BlackBoxCodegenTestGenerated.MultiDecl.class, BlackBoxCodegenTestGenerated.Namespace.class, BlackBoxCodegenTestGenerated.Objects.class, BlackBoxCodegenTestGenerated.OperatorConventions.class, BlackBoxCodegenTestGenerated.PrimitiveTypes.class, BlackBoxCodegenTestGenerated.Properties.class, BlackBoxCodegenTestGenerated.SafeCall.class, BlackBoxCodegenTestGenerated.Strings.class, BlackBoxCodegenTestGenerated.Super.class, BlackBoxCodegenTestGenerated.Traits.class, BlackBoxCodegenTestGenerated.TypeInfo.class, BlackBoxCodegenTestGenerated.Unit.class, BlackBoxCodegenTestGenerated.Vararg.class, BlackBoxCodegenTestGenerated.When.class}) public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { public void testAllFilesPresentInBox() throws Exception { JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/codegen/box"), "kt", true); @@ -2707,11 +2708,6 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { blackBoxFileByFullPath("compiler/testData/codegen/box/primitiveTypes/ea35963.kt"); } - @TestMetadata("emptyRanges.kt") - public void testEmptyRanges() throws Exception { - blackBoxFileByFullPath("compiler/testData/codegen/box/primitiveTypes/emptyRanges.kt"); - } - @TestMetadata("intLiteralIsNotNull.kt") public void testIntLiteralIsNotNull() throws Exception { blackBoxFileByFullPath("compiler/testData/codegen/box/primitiveTypes/intLiteralIsNotNull.kt"); @@ -2837,11 +2833,6 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { blackBoxFileByFullPath("compiler/testData/codegen/box/primitiveTypes/kt757.kt"); } - @TestMetadata("kt821.kt") - public void testKt821() throws Exception { - blackBoxFileByFullPath("compiler/testData/codegen/box/primitiveTypes/kt821.kt"); - } - @TestMetadata("kt828.kt") public void testKt828() throws Exception { blackBoxFileByFullPath("compiler/testData/codegen/box/primitiveTypes/kt828.kt"); @@ -2867,11 +2858,6 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { blackBoxFileByFullPath("compiler/testData/codegen/box/primitiveTypes/kt935.kt"); } - @TestMetadata("kt944.kt") - public void testKt944() throws Exception { - blackBoxFileByFullPath("compiler/testData/codegen/box/primitiveTypes/kt944.kt"); - } - @TestMetadata("kt945.kt") public void testKt945() throws Exception { blackBoxFileByFullPath("compiler/testData/codegen/box/primitiveTypes/kt945.kt"); @@ -2987,19 +2973,6 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { } - @TestMetadata("compiler/testData/codegen/box/ranges") - public static class Ranges extends AbstractBlackBoxCodegenTest { - public void testAllFilesPresentInRanges() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/codegen/box/ranges"), "kt", true); - } - - @TestMetadata("kt2596.kt") - public void testKt2596() throws Exception { - blackBoxFileByFullPath("compiler/testData/codegen/box/ranges/kt2596.kt"); - } - - } - @TestMetadata("compiler/testData/codegen/box/safeCall") public static class SafeCall extends AbstractBlackBoxCodegenTest { public void testAllFilesPresentInSafeCall() throws Exception { @@ -3354,7 +3327,6 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { suite.addTest(OperatorConventions.innerSuite()); suite.addTestSuite(PrimitiveTypes.class); suite.addTestSuite(Properties.class); - suite.addTestSuite(Ranges.class); suite.addTestSuite(SafeCall.class); suite.addTestSuite(Strings.class); suite.addTestSuite(Super.class);