From f440d97e04acef8520a82f94969ca0f4b8b9bbd7 Mon Sep 17 00:00:00 2001 From: Ilya Gorbunov Date: Sun, 5 Jul 2015 03:18:29 +0300 Subject: [PATCH] Remove unnecessary Char.toChar from tests. --- .../ranges/expression/inexactDownToMinValue.kt | 6 +++--- .../ranges/expression/inexactToMaxValue.kt | 6 +++--- .../ranges/expression/maxValueMinusTwoToMaxValue.kt | 6 +++--- .../ranges/expression/progressionDownToMinValue.kt | 6 +++--- .../progressionMaxValueMinusTwoToMaxValue.kt | 6 +++--- .../ranges/literal/inexactDownToMinValue.kt | 6 +++--- .../boxWithStdlib/ranges/literal/inexactToMaxValue.kt | 6 +++--- .../ranges/literal/maxValueMinusTwoToMaxValue.kt | 6 +++--- .../ranges/literal/progressionDownToMinValue.kt | 6 +++--- .../literal/progressionMaxValueMinusTwoToMaxValue.kt | 6 +++--- libraries/stdlib/test/collections/ArraysJVMTest.kt | 4 ++-- .../stdlib/test/language/RangeIterationJVMTest.kt | 10 +++++----- 12 files changed, 37 insertions(+), 37 deletions(-) diff --git a/compiler/testData/codegen/boxWithStdlib/ranges/expression/inexactDownToMinValue.kt b/compiler/testData/codegen/boxWithStdlib/ranges/expression/inexactDownToMinValue.kt index 2339845995d..f4d26ce7d35 100644 --- a/compiler/testData/codegen/boxWithStdlib/ranges/expression/inexactDownToMinValue.kt +++ b/compiler/testData/codegen/boxWithStdlib/ranges/expression/inexactDownToMinValue.kt @@ -55,13 +55,13 @@ fun box(): String { } val list5 = ArrayList() - val range5 = (MinC + 5).toChar() downTo MinC step 3 + val range5 = (MinC + 5) downTo MinC step 3 for (i in range5) { list5.add(i) if (list5.size() > 23) break } - if (list5 != listOf((MinC + 5).toChar(), (MinC + 2).toChar())) { - return "Wrong elements for (MinC + 5).toChar() downTo MinC step 3: $list5" + if (list5 != listOf((MinC + 5), (MinC + 2))) { + return "Wrong elements for (MinC + 5) downTo MinC step 3: $list5" } return "OK" diff --git a/compiler/testData/codegen/boxWithStdlib/ranges/expression/inexactToMaxValue.kt b/compiler/testData/codegen/boxWithStdlib/ranges/expression/inexactToMaxValue.kt index 5ae8ded829d..d5befa8aa5a 100644 --- a/compiler/testData/codegen/boxWithStdlib/ranges/expression/inexactToMaxValue.kt +++ b/compiler/testData/codegen/boxWithStdlib/ranges/expression/inexactToMaxValue.kt @@ -55,13 +55,13 @@ fun box(): String { } val list5 = ArrayList() - val range5 = (MaxC - 5).toChar()..MaxC step 3 + val range5 = (MaxC - 5)..MaxC step 3 for (i in range5) { list5.add(i) if (list5.size() > 23) break } - if (list5 != listOf((MaxC - 5).toChar(), (MaxC - 2).toChar())) { - return "Wrong elements for (MaxC - 5).toChar()..MaxC step 3: $list5" + if (list5 != listOf((MaxC - 5), (MaxC - 2))) { + return "Wrong elements for (MaxC - 5)..MaxC step 3: $list5" } return "OK" diff --git a/compiler/testData/codegen/boxWithStdlib/ranges/expression/maxValueMinusTwoToMaxValue.kt b/compiler/testData/codegen/boxWithStdlib/ranges/expression/maxValueMinusTwoToMaxValue.kt index 13fbca1e1cb..3ee48b17dde 100644 --- a/compiler/testData/codegen/boxWithStdlib/ranges/expression/maxValueMinusTwoToMaxValue.kt +++ b/compiler/testData/codegen/boxWithStdlib/ranges/expression/maxValueMinusTwoToMaxValue.kt @@ -55,13 +55,13 @@ fun box(): String { } val list5 = ArrayList() - val range5 = (MaxC - 2).toChar()..MaxC + val range5 = (MaxC - 2)..MaxC for (i in range5) { list5.add(i) if (list5.size() > 23) break } - if (list5 != listOf((MaxC - 2).toChar(), (MaxC - 1).toChar(), MaxC)) { - return "Wrong elements for (MaxC - 2).toChar()..MaxC: $list5" + if (list5 != listOf((MaxC - 2), (MaxC - 1), MaxC)) { + return "Wrong elements for (MaxC - 2)..MaxC: $list5" } return "OK" diff --git a/compiler/testData/codegen/boxWithStdlib/ranges/expression/progressionDownToMinValue.kt b/compiler/testData/codegen/boxWithStdlib/ranges/expression/progressionDownToMinValue.kt index 3d45cda9ea5..1531e67511c 100644 --- a/compiler/testData/codegen/boxWithStdlib/ranges/expression/progressionDownToMinValue.kt +++ b/compiler/testData/codegen/boxWithStdlib/ranges/expression/progressionDownToMinValue.kt @@ -55,13 +55,13 @@ fun box(): String { } val list5 = ArrayList() - val range5 = (MinC + 2).toChar() downTo MinC step 1 + val range5 = (MinC + 2) downTo MinC step 1 for (i in range5) { list5.add(i) if (list5.size() > 23) break } - if (list5 != listOf((MinC + 2).toChar(), (MinC + 1).toChar(), MinC)) { - return "Wrong elements for (MinC + 2).toChar() downTo MinC step 1: $list5" + if (list5 != listOf((MinC + 2), (MinC + 1), MinC)) { + return "Wrong elements for (MinC + 2) downTo MinC step 1: $list5" } return "OK" diff --git a/compiler/testData/codegen/boxWithStdlib/ranges/expression/progressionMaxValueMinusTwoToMaxValue.kt b/compiler/testData/codegen/boxWithStdlib/ranges/expression/progressionMaxValueMinusTwoToMaxValue.kt index f65cb237f61..9d9f13d7349 100644 --- a/compiler/testData/codegen/boxWithStdlib/ranges/expression/progressionMaxValueMinusTwoToMaxValue.kt +++ b/compiler/testData/codegen/boxWithStdlib/ranges/expression/progressionMaxValueMinusTwoToMaxValue.kt @@ -55,13 +55,13 @@ fun box(): String { } val list5 = ArrayList() - val range5 = (MaxC - 2).toChar()..MaxC step 2 + val range5 = (MaxC - 2)..MaxC step 2 for (i in range5) { list5.add(i) if (list5.size() > 23) break } - if (list5 != listOf((MaxC - 2).toChar(), MaxC)) { - return "Wrong elements for (MaxC - 2).toChar()..MaxC step 2: $list5" + if (list5 != listOf((MaxC - 2), MaxC)) { + return "Wrong elements for (MaxC - 2)..MaxC step 2: $list5" } return "OK" diff --git a/compiler/testData/codegen/boxWithStdlib/ranges/literal/inexactDownToMinValue.kt b/compiler/testData/codegen/boxWithStdlib/ranges/literal/inexactDownToMinValue.kt index cb91d07024b..c8b9e14014d 100644 --- a/compiler/testData/codegen/boxWithStdlib/ranges/literal/inexactDownToMinValue.kt +++ b/compiler/testData/codegen/boxWithStdlib/ranges/literal/inexactDownToMinValue.kt @@ -51,12 +51,12 @@ fun box(): String { } val list5 = ArrayList() - for (i in (MinC + 5).toChar() downTo MinC step 3) { + for (i in (MinC + 5) downTo MinC step 3) { list5.add(i) if (list5.size() > 23) break } - if (list5 != listOf((MinC + 5).toChar(), (MinC + 2).toChar())) { - return "Wrong elements for (MinC + 5).toChar() downTo MinC step 3: $list5" + if (list5 != listOf((MinC + 5), (MinC + 2))) { + return "Wrong elements for (MinC + 5) downTo MinC step 3: $list5" } return "OK" diff --git a/compiler/testData/codegen/boxWithStdlib/ranges/literal/inexactToMaxValue.kt b/compiler/testData/codegen/boxWithStdlib/ranges/literal/inexactToMaxValue.kt index 453cc240062..fc4b412712b 100644 --- a/compiler/testData/codegen/boxWithStdlib/ranges/literal/inexactToMaxValue.kt +++ b/compiler/testData/codegen/boxWithStdlib/ranges/literal/inexactToMaxValue.kt @@ -51,12 +51,12 @@ fun box(): String { } val list5 = ArrayList() - for (i in (MaxC - 5).toChar()..MaxC step 3) { + for (i in (MaxC - 5)..MaxC step 3) { list5.add(i) if (list5.size() > 23) break } - if (list5 != listOf((MaxC - 5).toChar(), (MaxC - 2).toChar())) { - return "Wrong elements for (MaxC - 5).toChar()..MaxC step 3: $list5" + if (list5 != listOf((MaxC - 5), (MaxC - 2))) { + return "Wrong elements for (MaxC - 5)..MaxC step 3: $list5" } return "OK" diff --git a/compiler/testData/codegen/boxWithStdlib/ranges/literal/maxValueMinusTwoToMaxValue.kt b/compiler/testData/codegen/boxWithStdlib/ranges/literal/maxValueMinusTwoToMaxValue.kt index 15d32a278cc..716ea1cc300 100644 --- a/compiler/testData/codegen/boxWithStdlib/ranges/literal/maxValueMinusTwoToMaxValue.kt +++ b/compiler/testData/codegen/boxWithStdlib/ranges/literal/maxValueMinusTwoToMaxValue.kt @@ -51,12 +51,12 @@ fun box(): String { } val list5 = ArrayList() - for (i in (MaxC - 2).toChar()..MaxC) { + for (i in (MaxC - 2)..MaxC) { list5.add(i) if (list5.size() > 23) break } - if (list5 != listOf((MaxC - 2).toChar(), (MaxC - 1).toChar(), MaxC)) { - return "Wrong elements for (MaxC - 2).toChar()..MaxC: $list5" + if (list5 != listOf((MaxC - 2), (MaxC - 1), MaxC)) { + return "Wrong elements for (MaxC - 2)..MaxC: $list5" } return "OK" diff --git a/compiler/testData/codegen/boxWithStdlib/ranges/literal/progressionDownToMinValue.kt b/compiler/testData/codegen/boxWithStdlib/ranges/literal/progressionDownToMinValue.kt index 19f8e9f5078..89b997b8a0d 100644 --- a/compiler/testData/codegen/boxWithStdlib/ranges/literal/progressionDownToMinValue.kt +++ b/compiler/testData/codegen/boxWithStdlib/ranges/literal/progressionDownToMinValue.kt @@ -51,12 +51,12 @@ fun box(): String { } val list5 = ArrayList() - for (i in (MinC + 2).toChar() downTo MinC step 1) { + for (i in (MinC + 2) downTo MinC step 1) { list5.add(i) if (list5.size() > 23) break } - if (list5 != listOf((MinC + 2).toChar(), (MinC + 1).toChar(), MinC)) { - return "Wrong elements for (MinC + 2).toChar() downTo MinC step 1: $list5" + if (list5 != listOf((MinC + 2), (MinC + 1), MinC)) { + return "Wrong elements for (MinC + 2) downTo MinC step 1: $list5" } return "OK" diff --git a/compiler/testData/codegen/boxWithStdlib/ranges/literal/progressionMaxValueMinusTwoToMaxValue.kt b/compiler/testData/codegen/boxWithStdlib/ranges/literal/progressionMaxValueMinusTwoToMaxValue.kt index 408f69acf01..d4c93ce04ae 100644 --- a/compiler/testData/codegen/boxWithStdlib/ranges/literal/progressionMaxValueMinusTwoToMaxValue.kt +++ b/compiler/testData/codegen/boxWithStdlib/ranges/literal/progressionMaxValueMinusTwoToMaxValue.kt @@ -51,12 +51,12 @@ fun box(): String { } val list5 = ArrayList() - for (i in (MaxC - 2).toChar()..MaxC step 2) { + for (i in (MaxC - 2)..MaxC step 2) { list5.add(i) if (list5.size() > 23) break } - if (list5 != listOf((MaxC - 2).toChar(), MaxC)) { - return "Wrong elements for (MaxC - 2).toChar()..MaxC step 2: $list5" + if (list5 != listOf((MaxC - 2), MaxC)) { + return "Wrong elements for (MaxC - 2)..MaxC step 2: $list5" } return "OK" diff --git a/libraries/stdlib/test/collections/ArraysJVMTest.kt b/libraries/stdlib/test/collections/ArraysJVMTest.kt index 32622573b0e..746198309dd 100644 --- a/libraries/stdlib/test/collections/ArraysJVMTest.kt +++ b/libraries/stdlib/test/collections/ArraysJVMTest.kt @@ -21,7 +21,7 @@ class ArraysJVMTest { checkContent(longArrayOf(0, 1, 2, 3, 4, 5).copyOf().iterator(), 6) { it.toLong() } checkContent(floatArrayOf(0.toFloat(), 1.toFloat(), 2.toFloat(), 3.toFloat()).copyOf().iterator(), 4) { it.toFloat() } checkContent(doubleArrayOf(0.0, 1.0, 2.0, 3.0, 4.0, 5.0).copyOf().iterator(), 6) { it.toDouble() } - checkContent(charArrayOf('0', '1', '2', '3', '4', '5').copyOf().iterator(), 6) { ('0' + it).toChar() } + checkContent(charArrayOf('0', '1', '2', '3', '4', '5').copyOf().iterator(), 6) { '0' + it } } test fun copyOfRange() { @@ -32,7 +32,7 @@ class ArraysJVMTest { checkContent(longArrayOf(0, 1, 2, 3, 4, 5).copyOfRange(0, 3).iterator(), 3) { it.toLong() } checkContent(floatArrayOf(0.toFloat(), 1.toFloat(), 2.toFloat(), 3.toFloat()).copyOfRange(0, 3).iterator(), 3) { it.toFloat() } checkContent(doubleArrayOf(0.0, 1.0, 2.0, 3.0, 4.0, 5.0).copyOfRange(0, 3).iterator(), 3) { it.toDouble() } - checkContent(charArrayOf('0', '1', '2', '3', '4', '5').copyOfRange(0, 3).iterator(), 3) { ('0' + it).toChar() } + checkContent(charArrayOf('0', '1', '2', '3', '4', '5').copyOfRange(0, 3).iterator(), 3) { '0' + it } } test fun reduce() { diff --git a/libraries/stdlib/test/language/RangeIterationJVMTest.kt b/libraries/stdlib/test/language/RangeIterationJVMTest.kt index 873f5f3d921..cef97c40cda 100644 --- a/libraries/stdlib/test/language/RangeIterationJVMTest.kt +++ b/libraries/stdlib/test/language/RangeIterationJVMTest.kt @@ -75,7 +75,7 @@ public class RangeIterationJVMTest { doTest((MaxS - 2).toShort()..MaxS, (MaxS - 2).toShort(), MaxS, 1, listOf((MaxS - 2).toShort(), (MaxS - 1).toShort(), MaxS)) doTest((MaxL - 2).toLong()..MaxL, (MaxL - 2).toLong(), MaxL, 1.toLong(), listOf((MaxL - 2).toLong(), (MaxL - 1).toLong(), MaxL)) - doTest((MaxC - 2).toChar()..MaxC, (MaxC - 2).toChar(), MaxC, 1, listOf((MaxC - 2).toChar(), (MaxC - 1).toChar(), MaxC)) + doTest((MaxC - 2)..MaxC, (MaxC - 2), MaxC, 1, listOf((MaxC - 2), (MaxC - 1), MaxC)) } test fun maxValueToMinValue() { @@ -102,7 +102,7 @@ public class RangeIterationJVMTest { doTest((MaxS - 2).toShort()..MaxS step 2, (MaxS - 2).toShort(), MaxS, 2, listOf((MaxS - 2).toShort(), MaxS)) doTest((MaxL - 2).toLong()..MaxL step 2, (MaxL - 2).toLong(), MaxL, 2.toLong(), listOf((MaxL - 2).toLong(), MaxL)) - doTest((MaxC - 2).toChar()..MaxC step 2, (MaxC - 2).toChar(), MaxC, 2, listOf((MaxC - 2).toChar(), MaxC)) + doTest((MaxC - 2)..MaxC step 2, (MaxC - 2), MaxC, 2, listOf((MaxC - 2), MaxC)) } test fun progressionMaxValueToMinValue() { @@ -129,7 +129,7 @@ public class RangeIterationJVMTest { doTest((MaxS - 5).toShort()..MaxS step 3, (MaxS - 5).toShort(), MaxS, 3, listOf((MaxS - 5).toShort(), (MaxS - 2).toShort())) doTest((MaxL - 5).toLong()..MaxL step 3, (MaxL - 5).toLong(), MaxL, 3.toLong(), listOf((MaxL - 5).toLong(), (MaxL - 2).toLong())) - doTest((MaxC - 5).toChar()..MaxC step 3, (MaxC - 5).toChar(), MaxC, 3, listOf((MaxC - 5).toChar(), (MaxC - 2).toChar())) + doTest((MaxC - 5)..MaxC step 3, (MaxC - 5), MaxC, 3, listOf((MaxC - 5), (MaxC - 2))) } test fun progressionDownToMinValue() { @@ -138,7 +138,7 @@ public class RangeIterationJVMTest { doTest((MinS + 2).toShort() downTo MinS step 1, (MinS + 2).toShort(), MinS, -1, listOf((MinS + 2).toShort(), (MinS + 1).toShort(), MinS)) doTest((MinL + 2).toLong() downTo MinL step 1, (MinL + 2).toLong(), MinL, -1.toLong(), listOf((MinL + 2).toLong(), (MinL + 1).toLong(), MinL)) - doTest((MinC + 2).toChar() downTo MinC step 1, (MinC + 2).toChar(), MinC, -1, listOf((MinC + 2).toChar(), (MinC + 1).toChar(), MinC)) + doTest((MinC + 2) downTo MinC step 1, (MinC + 2), MinC, -1, listOf((MinC + 2), (MinC + 1), MinC)) } test fun inexactDownToMinValue() { @@ -147,6 +147,6 @@ public class RangeIterationJVMTest { doTest((MinS + 5).toShort() downTo MinS step 3, (MinS + 5).toShort(), MinS, -3, listOf((MinS + 5).toShort(), (MinS + 2).toShort())) doTest((MinL + 5).toLong() downTo MinL step 3, (MinL + 5).toLong(), MinL, -3.toLong(), listOf((MinL + 5).toLong(), (MinL + 2).toLong())) - doTest((MinC + 5).toChar() downTo MinC step 3, (MinC + 5).toChar(), MinC, -3, listOf((MinC + 5).toChar(), (MinC + 2).toChar())) + doTest((MinC + 5) downTo MinC step 3, (MinC + 5), MinC, -3, listOf((MinC + 5), (MinC + 2))) } } \ No newline at end of file