diff --git a/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToReversedStep.kt b/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToReversedStep.kt new file mode 100644 index 00000000000..8d0f4686480 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToReversedStep.kt @@ -0,0 +1,21 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +val log = StringBuilder() + +fun logged(message: String, value: Int) = + value.also { log.append(message) } + +fun box(): String { + var sum = 0 + for (i in (logged("start;", 8) downTo logged("end;", 1)).reversed() step logged("step;", 2)) { + sum = sum * 10 + i + } + + assertEquals(1357, sum) + + assertEquals("start;end;step;", log.toString()) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToReversedStepReversed.kt b/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToReversedStepReversed.kt new file mode 100644 index 00000000000..4fd070cbf37 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToReversedStepReversed.kt @@ -0,0 +1,21 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +val log = StringBuilder() + +fun logged(message: String, value: Int) = + value.also { log.append(message) } + +fun box(): String { + var sum = 0 + for (i in ((logged("start;", 8) downTo logged("end;", 1)).reversed() step logged("step;", 2)).reversed()) { + sum = sum * 10 + i + } + + assertEquals(7531, sum) + + assertEquals("start;end;step;", log.toString()) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToReversedStepReversedStep.kt b/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToReversedStepReversedStep.kt new file mode 100644 index 00000000000..fc37dd3a01a --- /dev/null +++ b/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToReversedStepReversedStep.kt @@ -0,0 +1,21 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +val log = StringBuilder() + +fun logged(message: String, value: Int) = + value.also { log.append(message) } + +fun box(): String { + var sum = 0 + for (i in ((logged("start;", 10) downTo logged("end;", 1)).reversed() step logged("step2;", 2)).reversed() step logged("step3;", 3)) { + sum = sum * 10 + i + } + + assertEquals(963, sum) + + assertEquals("start;end;step2;step3;", log.toString()) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToStep.kt b/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToStep.kt new file mode 100644 index 00000000000..2e718a0a471 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToStep.kt @@ -0,0 +1,21 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +val log = StringBuilder() + +fun logged(message: String, value: Int) = + value.also { log.append(message) } + +fun box(): String { + var sum = 0 + for (i in logged("start;", 8) downTo logged("end;", 1) step logged("step;", 2)) { + sum = sum * 10 + i + } + + assertEquals(8642, sum) + + assertEquals("start;end;step;", log.toString()) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToStepReversed.kt b/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToStepReversed.kt new file mode 100644 index 00000000000..2fec56814cd --- /dev/null +++ b/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToStepReversed.kt @@ -0,0 +1,21 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +val log = StringBuilder() + +fun logged(message: String, value: Int) = + value.also { log.append(message) } + +fun box(): String { + var sum = 0 + for (i in (logged("start;", 8) downTo logged("end;", 1) step logged("step;", 2)).reversed()) { + sum = sum * 10 + i + } + + assertEquals(2468, sum) + + assertEquals("start;end;step;", log.toString()) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToStepReversedStep.kt b/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToStepReversedStep.kt new file mode 100644 index 00000000000..6e04eba982d --- /dev/null +++ b/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToStepReversedStep.kt @@ -0,0 +1,21 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +val log = StringBuilder() + +fun logged(message: String, value: Int) = + value.also { log.append(message) } + +fun box(): String { + var sum = 0 + for (i in (logged("start;", 9) downTo logged("end;", 0) step logged("step2;", 2)).reversed() step logged("step3;", 3)) { + sum = sum * 10 + i + } + + assertEquals(147, sum) + + assertEquals("start;end;step2;step3;", log.toString()) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToStepReversedStepReversed.kt b/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToStepReversedStepReversed.kt new file mode 100644 index 00000000000..bdd3a01c906 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToStepReversedStepReversed.kt @@ -0,0 +1,21 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +val log = StringBuilder() + +fun logged(message: String, value: Int) = + value.also { log.append(message) } + +fun box(): String { + var sum = 0 + for (i in ((logged("start;", 9) downTo logged("end;", 0) step logged("step2;", 2)).reversed() step logged("step3;", 3)).reversed()) { + sum = sum * 10 + i + } + + assertEquals(741, sum) + + assertEquals("start;end;step2;step3;", log.toString()) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToStepStep.kt b/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToStepStep.kt new file mode 100644 index 00000000000..11915f827a7 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToStepStep.kt @@ -0,0 +1,21 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +val log = StringBuilder() + +fun logged(message: String, value: Int) = + value.also { log.append(message) } + +fun box(): String { + var sum = 0 + for (i in logged("start;", 9) downTo logged("end;", 0) step logged("step2;", 2) step logged("step3;", 3)) { + sum = sum * 10 + i + } + + assertEquals(963, sum) + + assertEquals("start;end;step2;step3;", log.toString()) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralReversedStep.kt b/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralReversedStep.kt new file mode 100644 index 00000000000..4c58b930d6c --- /dev/null +++ b/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralReversedStep.kt @@ -0,0 +1,21 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +val log = StringBuilder() + +fun logged(message: String, value: Int) = + value.also { log.append(message) } + +fun box(): String { + var sum = 0 + for (i in (logged("start;", 1)..logged("end;", 8)).reversed() step logged("step;", 2)) { + sum = sum * 10 + i + } + + assertEquals(8642, sum) + + assertEquals("start;end;step;", log.toString()) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralReversedStepReversed.kt b/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralReversedStepReversed.kt new file mode 100644 index 00000000000..5f802dcad28 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralReversedStepReversed.kt @@ -0,0 +1,21 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +val log = StringBuilder() + +fun logged(message: String, value: Int) = + value.also { log.append(message) } + +fun box(): String { + var sum = 0 + for (i in ((logged("start;", 1)..logged("end;", 8)).reversed() step logged("step;", 2)).reversed()) { + sum = sum * 10 + i + } + + assertEquals(2468, sum) + + assertEquals("start;end;step;", log.toString()) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralReversedStepReversedStep.kt b/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralReversedStepReversedStep.kt new file mode 100644 index 00000000000..54842128a97 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralReversedStepReversedStep.kt @@ -0,0 +1,21 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +val log = StringBuilder() + +fun logged(message: String, value: Int) = + value.also { log.append(message) } + +fun box(): String { + var sum = 0 + for (i in ((logged("start;", 1)..logged("end;", 10)).reversed() step logged("step2;", 2)).reversed() step logged("step3;", 3)) { + sum = sum * 10 + i + } + + assertEquals(258, sum) + + assertEquals("start;end;step2;step3;", log.toString()) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralStep.kt b/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralStep.kt new file mode 100644 index 00000000000..1866a7cf17a --- /dev/null +++ b/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralStep.kt @@ -0,0 +1,21 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +val log = StringBuilder() + +fun logged(message: String, value: Int) = + value.also { log.append(message) } + +fun box(): String { + var sum = 0 + for (i in logged("start;", 1)..logged("end;", 8) step logged("step;", 2)) { + sum = sum * 10 + i + } + + assertEquals(1357, sum) + + assertEquals("start;end;step;", log.toString()) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralStepReversed.kt b/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralStepReversed.kt new file mode 100644 index 00000000000..9cb7555e957 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralStepReversed.kt @@ -0,0 +1,21 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +val log = StringBuilder() + +fun logged(message: String, value: Int) = + value.also { log.append(message) } + +fun box(): String { + var sum = 0 + for (i in (logged("start;", 1)..logged("end;", 8) step logged("step;", 2)).reversed()) { + sum = sum * 10 + i + } + + assertEquals(7531, sum) + + assertEquals("start;end;step;", log.toString()) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralStepReversedStep.kt b/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralStepReversedStep.kt new file mode 100644 index 00000000000..a5b685169f7 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralStepReversedStep.kt @@ -0,0 +1,21 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +val log = StringBuilder() + +fun logged(message: String, value: Int) = + value.also { log.append(message) } + +fun box(): String { + var sum = 0 + for (i in (logged("start;", 1)..logged("end;", 10) step logged("step2;", 2)).reversed() step logged("step3;", 3)) { + sum = sum * 10 + i + } + + assertEquals(963, sum) + + assertEquals("start;end;step2;step3;", log.toString()) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralStepReversedStepReversed.kt b/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralStepReversedStepReversed.kt new file mode 100644 index 00000000000..4b857b76258 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralStepReversedStepReversed.kt @@ -0,0 +1,21 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +val log = StringBuilder() + +fun logged(message: String, value: Int) = + value.also { log.append(message) } + +fun box(): String { + var sum = 0 + for (i in ((logged("start;", 1)..logged("end;", 10) step logged("step2;", 2)).reversed() step logged("step3;", 3)).reversed()) { + sum = sum * 10 + i + } + + assertEquals(369, sum) + + assertEquals("start;end;step2;step3;", log.toString()) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralStepStep.kt b/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralStepStep.kt new file mode 100644 index 00000000000..687eea1b142 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralStepStep.kt @@ -0,0 +1,21 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +val log = StringBuilder() + +fun logged(message: String, value: Int) = + value.also { log.append(message) } + +fun box(): String { + var sum = 0 + for (i in logged("start;", 1)..logged("end;", 10) step logged("step2;", 2) step logged("step3;", 3)) { + sum = sum * 10 + i + } + + assertEquals(147, sum) + + assertEquals("start;end;step2;step3;", log.toString()) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilReversedStep.kt b/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilReversedStep.kt new file mode 100644 index 00000000000..a8f066ba207 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilReversedStep.kt @@ -0,0 +1,21 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +val log = StringBuilder() + +fun logged(message: String, value: Int) = + value.also { log.append(message) } + +fun box(): String { + var sum = 0 + for (i in (logged("start;", 1) until logged("end;", 9)).reversed() step logged("step;", 2)) { + sum = sum * 10 + i + } + + assertEquals(8642, sum) + + assertEquals("start;end;step;", log.toString()) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilReversedStepReversed.kt b/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilReversedStepReversed.kt new file mode 100644 index 00000000000..ffc6592f0e3 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilReversedStepReversed.kt @@ -0,0 +1,21 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +val log = StringBuilder() + +fun logged(message: String, value: Int) = + value.also { log.append(message) } + +fun box(): String { + var sum = 0 + for (i in ((logged("start;", 1) until logged("end;", 9)).reversed() step logged("step;", 2)).reversed()) { + sum = sum * 10 + i + } + + assertEquals(2468, sum) + + assertEquals("start;end;step;", log.toString()) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilReversedStepReversedStep.kt b/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilReversedStepReversedStep.kt new file mode 100644 index 00000000000..e85cc6ff2fd --- /dev/null +++ b/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilReversedStepReversedStep.kt @@ -0,0 +1,21 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +val log = StringBuilder() + +fun logged(message: String, value: Int) = + value.also { log.append(message) } + +fun box(): String { + var sum = 0 + for (i in ((logged("start;", 1) until logged("end;", 11)).reversed() step logged("step2;", 2)).reversed() step logged("step3;", 3)) { + sum = sum * 10 + i + } + + assertEquals(258, sum) + + assertEquals("start;end;step2;step3;", log.toString()) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilStep.kt b/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilStep.kt new file mode 100644 index 00000000000..d349928ef90 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilStep.kt @@ -0,0 +1,21 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +val log = StringBuilder() + +fun logged(message: String, value: Int) = + value.also { log.append(message) } + +fun box(): String { + var sum = 0 + for (i in logged("start;", 1) until logged("end;", 9) step logged("step;", 2)) { + sum = sum * 10 + i + } + + assertEquals(1357, sum) + + assertEquals("start;end;step;", log.toString()) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilStepReversed.kt b/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilStepReversed.kt new file mode 100644 index 00000000000..ec98b9436f2 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilStepReversed.kt @@ -0,0 +1,21 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +val log = StringBuilder() + +fun logged(message: String, value: Int) = + value.also { log.append(message) } + +fun box(): String { + var sum = 0 + for (i in (logged("start;", 1) until logged("end;", 9) step logged("step;", 2)).reversed()) { + sum = sum * 10 + i + } + + assertEquals(7531, sum) + + assertEquals("start;end;step;", log.toString()) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilStepReversedStep.kt b/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilStepReversedStep.kt new file mode 100644 index 00000000000..bbef32df651 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilStepReversedStep.kt @@ -0,0 +1,21 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +val log = StringBuilder() + +fun logged(message: String, value: Int) = + value.also { log.append(message) } + +fun box(): String { + var sum = 0 + for (i in (logged("start;", 1) until logged("end;", 11) step logged("step2;", 2)).reversed() step logged("step3;", 3)) { + sum = sum * 10 + i + } + + assertEquals(963, sum) + + assertEquals("start;end;step2;step3;", log.toString()) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilStepReversedStepReversed.kt b/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilStepReversedStepReversed.kt new file mode 100644 index 00000000000..194262dfd85 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilStepReversedStepReversed.kt @@ -0,0 +1,21 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +val log = StringBuilder() + +fun logged(message: String, value: Int) = + value.also { log.append(message) } + +fun box(): String { + var sum = 0 + for (i in ((logged("start;", 1) until logged("end;", 11) step logged("step2;", 2)).reversed() step logged("step3;", 3)).reversed()) { + sum = sum * 10 + i + } + + assertEquals(369, sum) + + assertEquals("start;end;step2;step3;", log.toString()) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilStepStep.kt b/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilStepStep.kt new file mode 100644 index 00000000000..a694fcd9c96 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilStepStep.kt @@ -0,0 +1,21 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +val log = StringBuilder() + +fun logged(message: String, value: Int) = + value.also { log.append(message) } + +fun box(): String { + var sum = 0 + for (i in logged("start;", 1) until logged("end;", 11) step logged("step2;", 2) step logged("step3;", 3)) { + sum = sum * 10 + i + } + + assertEquals(147, sum) + + assertEquals("start;end;step2;step3;", log.toString()) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/downTo/emptyProgression.kt b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/emptyProgression.kt new file mode 100644 index 00000000000..6401b43c368 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/emptyProgression.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 1 downTo 2 + for (i in intProgression step 2) { + intList += i + } + assertTrue(intList.isEmpty()) + + val longList = mutableListOf() + val longProgression = 1L downTo 2L + for (i in longProgression step 2L) { + longList += i + } + assertTrue(longList.isEmpty()) + + val charList = mutableListOf() + val charProgression = 'a' downTo 'b' + for (i in charProgression step 2) { + charList += i + } + assertTrue(charList.isEmpty()) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/downTo/illegalStepNegative.kt b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/illegalStepNegative.kt new file mode 100644 index 00000000000..a400de9de73 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/illegalStepNegative.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + assertFailsWith { + val intProgression = 7 downTo 1 + for (i in intProgression step -1) { + } + } + + assertFailsWith { + val longProgression = 7L downTo 1L + for (i in longProgression step -1L) { + } + } + + assertFailsWith { + val charProgression = 'g' downTo 'a' + for (i in charProgression step -1) { + } + } + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/downTo/illegalStepNonConst.kt b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/illegalStepNonConst.kt new file mode 100644 index 00000000000..a7c8971455b --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/illegalStepNonConst.kt @@ -0,0 +1,27 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun zero() = 0 + +fun box(): String { + assertFailsWith { + val intProgression = 7 downTo 1 + for (i in intProgression step zero()) { + } + } + + assertFailsWith { + val longProgression = 7L downTo 1L + for (i in longProgression step zero().toLong()) { + } + } + + assertFailsWith { + val charProgression = 'g' downTo 'a' + for (i in charProgression step zero()) { + } + } + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/downTo/illegalStepThenLegalStep.kt b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/illegalStepThenLegalStep.kt new file mode 100644 index 00000000000..66af5bc4dce --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/illegalStepThenLegalStep.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + assertFailsWith { + val intProgression = 7 downTo 1 + for (i in intProgression step 0 step 2) { + } + } + + assertFailsWith { + val longProgression = 7L downTo 1L + for (i in longProgression step 0L step 2L) { + } + } + + assertFailsWith { + val charProgression = 'g' downTo 'a' + for (i in charProgression step 0 step 2) { + } + } + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/downTo/illegalStepZero.kt b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/illegalStepZero.kt new file mode 100644 index 00000000000..83c0a906b3d --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/illegalStepZero.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + assertFailsWith { + val intProgression = 7 downTo 1 + for (i in intProgression step 0) { + } + } + + assertFailsWith { + val longProgression = 7L downTo 1L + for (i in longProgression step 0L) { + } + } + + assertFailsWith { + val charProgression = 'g' downTo 'a' + for (i in charProgression step 0) { + } + } + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/downTo/legalStepThenIllegalStep.kt b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/legalStepThenIllegalStep.kt new file mode 100644 index 00000000000..c7481b441af --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/legalStepThenIllegalStep.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + assertFailsWith { + val intProgression = 7 downTo 1 + for (i in intProgression step 2 step 0) { + } + } + + assertFailsWith { + val longProgression = 7L downTo 1L + for (i in longProgression step 2L step 0L) { + } + } + + assertFailsWith { + val charProgression = 'g' downTo 'a' + for (i in charProgression step 2 step 0) { + } + } + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/downTo/maxValueToMinValueStepMaxValue.kt b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/maxValueToMinValueStepMaxValue.kt new file mode 100644 index 00000000000..f96923c4724 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/maxValueToMinValueStepMaxValue.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = Int.MAX_VALUE downTo Int.MIN_VALUE + for (i in intProgression step Int.MAX_VALUE) { + intList += i + } + assertEquals(listOf(Int.MAX_VALUE, 0, Int.MIN_VALUE + 1), intList) + + val longList = mutableListOf() + val longProgression = Long.MAX_VALUE downTo Long.MIN_VALUE + for (i in longProgression step Long.MAX_VALUE) { + longList += i + } + assertEquals(listOf(Long.MAX_VALUE, 0, Long.MIN_VALUE + 1), longList) + + val charList = mutableListOf() + val charProgression = Char.MAX_VALUE downTo Char.MIN_VALUE + for (i in charProgression step Char.MAX_VALUE.toInt()) { + charList += i + } + assertEquals(listOf(Char.MAX_VALUE, Char.MIN_VALUE), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/downTo/maxValueToOneStepMaxValue.kt b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/maxValueToOneStepMaxValue.kt new file mode 100644 index 00000000000..cdf0bcf9a8c --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/maxValueToOneStepMaxValue.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = Int.MAX_VALUE downTo 1 + for (i in intProgression step Int.MAX_VALUE) { + intList += i + } + assertEquals(listOf(Int.MAX_VALUE), intList) + + val longList = mutableListOf() + val longProgression = Long.MAX_VALUE downTo 1L + for (i in longProgression step Long.MAX_VALUE) { + longList += i + } + assertEquals(listOf(Long.MAX_VALUE), longList) + + val charList = mutableListOf() + val charProgression = Char.MAX_VALUE downTo 1.toChar() + for (i in charProgression step Char.MAX_VALUE.toInt()) { + charList += i + } + assertEquals(listOf(Char.MAX_VALUE), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/downTo/maxValueToZeroStepMaxValue.kt b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/maxValueToZeroStepMaxValue.kt new file mode 100644 index 00000000000..0a86a79db2b --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/maxValueToZeroStepMaxValue.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = Int.MAX_VALUE downTo 0 + for (i in intProgression step Int.MAX_VALUE) { + intList += i + } + assertEquals(listOf(Int.MAX_VALUE, 0), intList) + + val longList = mutableListOf() + val longProgression = Long.MAX_VALUE downTo 0L + for (i in longProgression step Long.MAX_VALUE) { + longList += i + } + assertEquals(listOf(Long.MAX_VALUE, 0L), longList) + + val charList = mutableListOf() + val charProgression = Char.MAX_VALUE downTo 0.toChar() + for (i in charProgression step Char.MAX_VALUE.toInt()) { + charList += i + } + assertEquals(listOf(Char.MAX_VALUE, 0.toChar()), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/downTo/mixedTypeStep.kt b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/mixedTypeStep.kt new file mode 100644 index 00000000000..8c805d0058e --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/mixedTypeStep.kt @@ -0,0 +1,21 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 7.toByte() downTo 1.toShort() + for (i in intProgression step 2) { + intList += i + } + assertEquals(listOf(7, 5, 3, 1), intList) + + val longList = mutableListOf() + val longProgression = 7 downTo 1L + for (i in longProgression step 2) { + longList += i + } + assertEquals(listOf(7L, 5L, 3L, 1L), longList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepOneThenStepOne.kt b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepOneThenStepOne.kt new file mode 100644 index 00000000000..81cde96a222 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepOneThenStepOne.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 4 downTo 1 + for (i in intProgression step 1 step 1) { + intList += i + } + assertEquals(listOf(4, 3, 2, 1), intList) + + val longList = mutableListOf() + val longProgression = 4L downTo 1L + for (i in longProgression step 1L step 1L) { + longList += i + } + assertEquals(listOf(4L, 3L, 2L, 1L), longList) + + val charList = mutableListOf() + val charProgression = 'd' downTo 'a' + for (i in charProgression step 1 step 1) { + charList += i + } + assertEquals(listOf('d', 'c', 'b', 'a'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepThenSameStep.kt b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepThenSameStep.kt new file mode 100644 index 00000000000..98da6bd12b8 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepThenSameStep.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 8 downTo 1 + for (i in intProgression step 2 step 2) { + intList += i + } + assertEquals(listOf(8, 6, 4, 2), intList) + + val longList = mutableListOf() + val longProgression = 8L downTo 1L + for (i in longProgression step 2L step 2L) { + longList += i + } + assertEquals(listOf(8L, 6L, 4L, 2L), longList) + + val charList = mutableListOf() + val charProgression = 'h' downTo 'a' + for (i in charProgression step 2 step 2) { + charList += i + } + assertEquals(listOf('h', 'f', 'd', 'b'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepToSameLastThenStepOne.kt b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepToSameLastThenStepOne.kt new file mode 100644 index 00000000000..2a7b4ed128e --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepToSameLastThenStepOne.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 5 downTo 1 + for (i in intProgression step 2 step 1) { + intList += i + } + assertEquals(listOf(5, 4, 3, 2, 1), intList) + + val longList = mutableListOf() + val longProgression = 5L downTo 1L + for (i in longProgression step 2L step 1L) { + longList += i + } + assertEquals(listOf(5L, 4L, 3L, 2L, 1L), longList) + + val charList = mutableListOf() + val charProgression = 'e' downTo 'a' + for (i in charProgression step 2 step 1) { + charList += i + } + assertEquals(listOf('e', 'd', 'c', 'b', 'a'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepToSameLastThenStepToSameLast.kt b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepToSameLastThenStepToSameLast.kt new file mode 100644 index 00000000000..0ee7d432b6c --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepToSameLastThenStepToSameLast.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 7 downTo 1 + for (i in intProgression step 3 step 2) { + intList += i + } + assertEquals(listOf(7, 5, 3, 1), intList) + + val longList = mutableListOf() + val longProgression = 7L downTo 1L + for (i in longProgression step 3L step 2L) { + longList += i + } + assertEquals(listOf(7L, 5L, 3L, 1L), longList) + + val charList = mutableListOf() + val charProgression = 'g' downTo 'a' + for (i in charProgression step 3 step 2) { + charList += i + } + assertEquals(listOf('g', 'e', 'c', 'a'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepToSameLastThenStepToSmallerLast.kt b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepToSameLastThenStepToSmallerLast.kt new file mode 100644 index 00000000000..a6dff6d8e06 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepToSameLastThenStepToSmallerLast.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 10 downTo 1 + for (i in intProgression step 3 step 2) { + intList += i + } + assertEquals(listOf(10, 8, 6, 4, 2), intList) + + val longList = mutableListOf() + val longProgression = 10L downTo 1L + for (i in longProgression step 3L step 2L) { + longList += i + } + assertEquals(listOf(10L, 8L, 6L, 4L, 2L), longList) + + val charList = mutableListOf() + val charProgression = 'j' downTo 'a' + for (i in charProgression step 3 step 2) { + charList += i + } + assertEquals(listOf('j', 'h', 'f', 'd', 'b'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepToSmallerLastThenStepOne.kt b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepToSmallerLastThenStepOne.kt new file mode 100644 index 00000000000..249748fd383 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepToSmallerLastThenStepOne.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 6 downTo 1 + for (i in intProgression step 2 step 1) { + intList += i + } + assertEquals(listOf(6, 5, 4, 3, 2), intList) + + val longList = mutableListOf() + val longProgression = 6L downTo 1L + for (i in longProgression step 2L step 1L) { + longList += i + } + assertEquals(listOf(6L, 5L, 4L, 3L, 2L), longList) + + val charList = mutableListOf() + val charProgression = 'f' downTo 'a' + for (i in charProgression step 2 step 1) { + charList += i + } + assertEquals(listOf('f', 'e', 'd', 'c', 'b'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepToSmallerLastThenStepToSameLast.kt b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepToSmallerLastThenStepToSameLast.kt new file mode 100644 index 00000000000..f570e3b8cba --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepToSmallerLastThenStepToSameLast.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 8 downTo 1 + for (i in intProgression step 2 step 3) { + intList += i + } + assertEquals(listOf(8, 5, 2), intList) + + val longList = mutableListOf() + val longProgression = 8L downTo 1L + for (i in longProgression step 2L step 3L) { + longList += i + } + assertEquals(listOf(8L, 5L, 2L), longList) + + val charList = mutableListOf() + val charProgression = 'h' downTo 'a' + for (i in charProgression step 2 step 3) { + charList += i + } + assertEquals(listOf('h', 'e', 'b'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepToSmallerLastThenStepToSmallerLast.kt b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepToSmallerLastThenStepToSmallerLast.kt new file mode 100644 index 00000000000..3d7c0ad22b2 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepToSmallerLastThenStepToSmallerLast.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 10 downTo 1 + for (i in intProgression step 2 step 3) { + intList += i + } + assertEquals(listOf(10, 7, 4), intList) + + val longList = mutableListOf() + val longProgression = 10L downTo 1L + for (i in longProgression step 2L step 3L) { + longList += i + } + assertEquals(listOf(10L, 7L, 4L), longList) + + val charList = mutableListOf() + val charProgression = 'j' downTo 'a' + for (i in charProgression step 2 step 3) { + charList += i + } + assertEquals(listOf('j', 'g', 'd'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/downTo/reversed/reversedThenStep.kt b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/reversed/reversedThenStep.kt new file mode 100644 index 00000000000..a02ac1e799f --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/reversed/reversedThenStep.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in (8 downTo 1).reversed() step 2) { + intList += i + } + assertEquals(listOf(1, 3, 5, 7), intList) + + val longList = mutableListOf() + for (i in (8L downTo 1L).reversed() step 2L) { + longList += i + } + assertEquals(listOf(1L, 3L, 5L, 7L), longList) + + val charList = mutableListOf() + for (i in ('h' downTo 'a').reversed() step 2) { + charList += i + } + assertEquals(listOf('a', 'c', 'e', 'g'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/downTo/reversed/reversedThenStepThenReversed.kt b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/reversed/reversedThenStepThenReversed.kt new file mode 100644 index 00000000000..1a65b80816d --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/reversed/reversedThenStepThenReversed.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in ((8 downTo 1).reversed() step 2).reversed()) { + intList += i + } + assertEquals(listOf(7, 5, 3, 1), intList) + + val longList = mutableListOf() + for (i in ((8L downTo 1L).reversed() step 2L).reversed()) { + longList += i + } + assertEquals(listOf(7L, 5L, 3L, 1L), longList) + + val charList = mutableListOf() + for (i in (('h' downTo 'a').reversed() step 2).reversed()) { + charList += i + } + assertEquals(listOf('g', 'e', 'c', 'a'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/downTo/reversed/reversedThenStepThenReversedThenStep.kt b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/reversed/reversedThenStepThenReversedThenStep.kt new file mode 100644 index 00000000000..47b6006406e --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/reversed/reversedThenStepThenReversedThenStep.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in ((10 downTo 1).reversed() step 2).reversed() step 3) { + intList += i + } + assertEquals(listOf(9, 6, 3), intList) + + val longList = mutableListOf() + for (i in ((10L downTo 1L).reversed() step 2L).reversed() step 3L) { + longList += i + } + assertEquals(listOf(9L, 6L, 3L), longList) + + val charList = mutableListOf() + for (i in (('j' downTo 'a').reversed() step 2).reversed() step 3) { + charList += i + } + assertEquals(listOf('i', 'f', 'c'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/downTo/reversed/stepThenReversed.kt b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/reversed/stepThenReversed.kt new file mode 100644 index 00000000000..521d398dd49 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/reversed/stepThenReversed.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in (8 downTo 1 step 2).reversed()) { + intList += i + } + assertEquals(listOf(2, 4, 6, 8), intList) + + val longList = mutableListOf() + for (i in (8L downTo 1L step 2L).reversed()) { + longList += i + } + assertEquals(listOf(2L, 4L, 6L, 8L), longList) + + val charList = mutableListOf() + for (i in ('h' downTo 'a' step 2).reversed()) { + charList += i + } + assertEquals(listOf('b', 'd', 'f', 'h'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/downTo/reversed/stepThenReversedThenStep.kt b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/reversed/stepThenReversedThenStep.kt new file mode 100644 index 00000000000..e8101fd765f --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/reversed/stepThenReversedThenStep.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in (10 downTo 1 step 2).reversed() step 3) { + intList += i + } + assertEquals(listOf(2, 5, 8), intList) + + val longList = mutableListOf() + for (i in (10L downTo 1L step 2L).reversed() step 3L) { + longList += i + } + assertEquals(listOf(2L, 5L, 8L), longList) + + val charList = mutableListOf() + for (i in ('j' downTo 'a' step 2).reversed() step 3) { + charList += i + } + assertEquals(listOf('b', 'e', 'h'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/downTo/reversed/stepThenReversedThenStepThenReversed.kt b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/reversed/stepThenReversedThenStepThenReversed.kt new file mode 100644 index 00000000000..943ba1429fb --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/reversed/stepThenReversedThenStepThenReversed.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in ((10 downTo 1 step 2).reversed() step 3).reversed()) { + intList += i + } + assertEquals(listOf(8, 5, 2), intList) + + val longList = mutableListOf() + for (i in ((10L downTo 1L step 2L).reversed() step 3L).reversed()) { + longList += i + } + assertEquals(listOf(8L, 5L, 2L), longList) + + val charList = mutableListOf() + for (i in (('j' downTo 'a' step 2).reversed() step 3).reversed()) { + charList += i + } + assertEquals(listOf('h', 'e', 'b'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/downTo/singleElementStepTwo.kt b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/singleElementStepTwo.kt new file mode 100644 index 00000000000..419b90edb89 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/singleElementStepTwo.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 1 downTo 1 + for (i in intProgression step 2) { + intList += i + } + assertEquals(listOf(1), intList) + + val longList = mutableListOf() + val longProgression = 1L downTo 1L + for (i in longProgression step 2L) { + longList += i + } + assertEquals(listOf(1L), longList) + + val charList = mutableListOf() + val charProgression = 'a' downTo 'a' + for (i in charProgression step 2) { + charList += i + } + assertEquals(listOf('a'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/downTo/stepNonConst.kt b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/stepNonConst.kt new file mode 100644 index 00000000000..328bc66f761 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/stepNonConst.kt @@ -0,0 +1,30 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun two() = 2 + +fun box(): String { + val intList = mutableListOf() + val intProgression = 8 downTo 1 + for (i in intProgression step two()) { + intList += i + } + assertEquals(listOf(8, 6, 4, 2), intList) + + val longList = mutableListOf() + val longProgression = 8L downTo 1L + for (i in longProgression step two().toLong()) { + longList += i + } + assertEquals(listOf(8L, 6L, 4L, 2L), longList) + + val charList = mutableListOf() + val charProgression = 'h' downTo 'a' + for (i in charProgression step two()) { + charList += i + } + assertEquals(listOf('h', 'f', 'd', 'b'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/downTo/stepOne.kt b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/stepOne.kt new file mode 100644 index 00000000000..d98ae1d38ca --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/stepOne.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 4 downTo 1 + for (i in intProgression step 1) { + intList += i + } + assertEquals(listOf(4, 3, 2, 1), intList) + + val longList = mutableListOf() + val longProgression = 4L downTo 1L + for (i in longProgression step 1L) { + longList += i + } + assertEquals(listOf(4L, 3L, 2L, 1L), longList) + + val charList = mutableListOf() + val charProgression = 'd' downTo 'a' + for (i in charProgression step 1) { + charList += i + } + assertEquals(listOf('d', 'c', 'b', 'a'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/downTo/stepToOutsideRange.kt b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/stepToOutsideRange.kt new file mode 100644 index 00000000000..8093b20bad0 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/stepToOutsideRange.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 7 downTo 1 + for (i in intProgression step 7) { + intList += i + } + assertEquals(listOf(7), intList) + + val longList = mutableListOf() + val longProgression = 7L downTo 1L + for (i in longProgression step 7L) { + longList += i + } + assertEquals(listOf(7L), longList) + + val charList = mutableListOf() + val charProgression = 'g' downTo 'a' + for (i in charProgression step 7) { + charList += i + } + assertEquals(listOf('g'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/downTo/stepToSameLast.kt b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/stepToSameLast.kt new file mode 100644 index 00000000000..e3b20c2a390 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/stepToSameLast.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 7 downTo 1 + for (i in intProgression step 2) { + intList += i + } + assertEquals(listOf(7, 5, 3, 1), intList) + + val longList = mutableListOf() + val longProgression = 7L downTo 1L + for (i in longProgression step 2L) { + longList += i + } + assertEquals(listOf(7L, 5L, 3L, 1L), longList) + + val charList = mutableListOf() + val charProgression = 'g' downTo 'a' + for (i in charProgression step 2) { + charList += i + } + assertEquals(listOf('g', 'e', 'c', 'a'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/downTo/stepToSmallerLast.kt b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/stepToSmallerLast.kt new file mode 100644 index 00000000000..0fd58bedecc --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/downTo/stepToSmallerLast.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 8 downTo 1 + for (i in intProgression step 2) { + intList += i + } + assertEquals(listOf(8, 6, 4, 2), intList) + + val longList = mutableListOf() + val longProgression = 8L downTo 1L + for (i in longProgression step 2L) { + longList += i + } + assertEquals(listOf(8L, 6L, 4L, 2L), longList) + + val charList = mutableListOf() + val charProgression = 'h' downTo 'a' + for (i in charProgression step 2) { + charList += i + } + assertEquals(listOf('h', 'f', 'd', 'b'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/emptyProgression.kt b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/emptyProgression.kt new file mode 100644 index 00000000000..5f43edda3f8 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/emptyProgression.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 2..1 + for (i in intProgression step 2) { + intList += i + } + assertTrue(intList.isEmpty()) + + val longList = mutableListOf() + val longProgression = 2L..1L + for (i in longProgression step 2L) { + longList += i + } + assertTrue(longList.isEmpty()) + + val charList = mutableListOf() + val charProgression = 'b'..'a' + for (i in charProgression step 2) { + charList += i + } + assertTrue(charList.isEmpty()) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/illegalStepNegative.kt b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/illegalStepNegative.kt new file mode 100644 index 00000000000..bbab8a3a30e --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/illegalStepNegative.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + assertFailsWith { + val intProgression = 1..7 + for (i in intProgression step -1) { + } + } + + assertFailsWith { + val longProgression = 1L..7L + for (i in longProgression step -1L) { + } + } + + assertFailsWith { + val charProgression = 'a'..'g' + for (i in charProgression step -1) { + } + } + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/illegalStepNonConst.kt b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/illegalStepNonConst.kt new file mode 100644 index 00000000000..aa6df6c5297 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/illegalStepNonConst.kt @@ -0,0 +1,27 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun zero() = 0 + +fun box(): String { + assertFailsWith { + val intProgression = 1..7 + for (i in intProgression step zero()) { + } + } + + assertFailsWith { + val longProgression = 1L..7L + for (i in longProgression step zero().toLong()) { + } + } + + assertFailsWith { + val charProgression = 'a'..'g' + for (i in charProgression step zero()) { + } + } + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/illegalStepThenLegalStep.kt b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/illegalStepThenLegalStep.kt new file mode 100644 index 00000000000..49f4c419b9c --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/illegalStepThenLegalStep.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + assertFailsWith { + val intProgression = 1..7 + for (i in intProgression step 0 step 2) { + } + } + + assertFailsWith { + val longProgression = 1L..7L + for (i in longProgression step 0L step 2L) { + } + } + + assertFailsWith { + val charProgression = 'a'..'g' + for (i in charProgression step 0 step 2) { + } + } + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/illegalStepZero.kt b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/illegalStepZero.kt new file mode 100644 index 00000000000..2690ae4555f --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/illegalStepZero.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + assertFailsWith { + val intProgression = 1..7 + for (i in intProgression step 0) { + } + } + + assertFailsWith { + val longProgression = 1L..7L + for (i in longProgression step 0L) { + } + } + + assertFailsWith { + val charProgression = 'a'..'g' + for (i in charProgression step 0) { + } + } + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/legalStepThenIllegalStep.kt b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/legalStepThenIllegalStep.kt new file mode 100644 index 00000000000..8203bef4cdc --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/legalStepThenIllegalStep.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + assertFailsWith { + val intProgression = 1..7 + for (i in intProgression step 2 step 0) { + } + } + + assertFailsWith { + val longProgression = 1L..7L + for (i in longProgression step 2L step 0L) { + } + } + + assertFailsWith { + val charProgression = 'a'..'g' + for (i in charProgression step 2 step 0) { + } + } + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/minValueToMaxValueStepMaxValue.kt b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/minValueToMaxValueStepMaxValue.kt new file mode 100644 index 00000000000..bf0f354e1a7 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/minValueToMaxValueStepMaxValue.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = Int.MIN_VALUE..Int.MAX_VALUE + for (i in intProgression step Int.MAX_VALUE) { + intList += i + } + assertEquals(listOf(Int.MIN_VALUE, -1, Int.MAX_VALUE - 1), intList) + + val longList = mutableListOf() + val longProgression = Long.MIN_VALUE..Long.MAX_VALUE + for (i in longProgression step Long.MAX_VALUE) { + longList += i + } + assertEquals(listOf(Long.MIN_VALUE, -1L, Long.MAX_VALUE - 1), longList) + + val charList = mutableListOf() + val charProgression = Char.MIN_VALUE..Char.MAX_VALUE + for (i in charProgression step Char.MAX_VALUE.toInt()) { + charList += i + } + assertEquals(listOf(Char.MIN_VALUE, Char.MAX_VALUE), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/mixedTypeStep.kt b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/mixedTypeStep.kt new file mode 100644 index 00000000000..ea535640e52 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/mixedTypeStep.kt @@ -0,0 +1,21 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 1.toShort()..7.toByte() + for (i in intProgression step 2) { + intList += i + } + assertEquals(listOf(1, 3, 5, 7), intList) + + val longList = mutableListOf() + val longProgression = 1L..7 + for (i in longProgression step 2) { + longList += i + } + assertEquals(listOf(1L, 3L, 5L, 7L), longList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepOneThenStepOne.kt b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepOneThenStepOne.kt new file mode 100644 index 00000000000..84ac73f8b39 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepOneThenStepOne.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 1..4 + for (i in intProgression step 1 step 1) { + intList += i + } + assertEquals(listOf(1, 2, 3, 4), intList) + + val longList = mutableListOf() + val longProgression = 1L..4L + for (i in longProgression step 1L step 1L) { + longList += i + } + assertEquals(listOf(1L, 2L, 3L, 4L), longList) + + val charList = mutableListOf() + val charProgression = 'a'..'d' + for (i in charProgression step 1 step 1) { + charList += i + } + assertEquals(listOf('a', 'b', 'c', 'd'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepThenSameStep.kt b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepThenSameStep.kt new file mode 100644 index 00000000000..be74c5d3474 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepThenSameStep.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 1..8 + for (i in intProgression step 2 step 2) { + intList += i + } + assertEquals(listOf(1, 3, 5, 7), intList) + + val longList = mutableListOf() + val longProgression = 1L..8L + for (i in longProgression step 2L step 2L) { + longList += i + } + assertEquals(listOf(1L, 3L, 5L, 7L), longList) + + val charList = mutableListOf() + val charProgression = 'a'..'h' + for (i in charProgression step 2 step 2) { + charList += i + } + assertEquals(listOf('a', 'c', 'e', 'g'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepToSameLastThenStepOne.kt b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepToSameLastThenStepOne.kt new file mode 100644 index 00000000000..1ee39bc86e6 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepToSameLastThenStepOne.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 1..5 + for (i in intProgression step 2 step 1) { + intList += i + } + assertEquals(listOf(1, 2, 3, 4, 5), intList) + + val longList = mutableListOf() + val longProgression = 1L..5L + for (i in longProgression step 2L step 1L) { + longList += i + } + assertEquals(listOf(1L, 2L, 3L, 4L, 5L), longList) + + val charList = mutableListOf() + val charProgression = 'a'..'e' + for (i in charProgression step 2 step 1) { + charList += i + } + assertEquals(listOf('a', 'b', 'c', 'd', 'e'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepToSameLastThenStepToSameLast.kt b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepToSameLastThenStepToSameLast.kt new file mode 100644 index 00000000000..5db3161cf82 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepToSameLastThenStepToSameLast.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 1..7 + for (i in intProgression step 3 step 2) { + intList += i + } + assertEquals(listOf(1, 3, 5, 7), intList) + + val longList = mutableListOf() + val longProgression = 1L..7L + for (i in longProgression step 3L step 2L) { + longList += i + } + assertEquals(listOf(1L, 3L, 5L, 7L), longList) + + val charList = mutableListOf() + val charProgression = 'a'..'g' + for (i in charProgression step 3 step 2) { + charList += i + } + assertEquals(listOf('a', 'c', 'e', 'g'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepToSameLastThenStepToSmallerLast.kt b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepToSameLastThenStepToSmallerLast.kt new file mode 100644 index 00000000000..39d4b12849d --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepToSameLastThenStepToSmallerLast.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 1..10 + for (i in intProgression step 3 step 2) { + intList += i + } + assertEquals(listOf(1, 3, 5, 7, 9), intList) + + val longList = mutableListOf() + val longProgression = 1L..10L + for (i in longProgression step 3L step 2L) { + longList += i + } + assertEquals(listOf(1L, 3L, 5L, 7L, 9L), longList) + + val charList = mutableListOf() + val charProgression = 'a'..'j' + for (i in charProgression step 3 step 2) { + charList += i + } + assertEquals(listOf('a', 'c', 'e', 'g', 'i'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepToSmallerLastThenStepOne.kt b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepToSmallerLastThenStepOne.kt new file mode 100644 index 00000000000..2bce183d22b --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepToSmallerLastThenStepOne.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 1..6 + for (i in intProgression step 2 step 1) { + intList += i + } + assertEquals(listOf(1, 2, 3, 4, 5), intList) + + val longList = mutableListOf() + val longProgression = 1L..6L + for (i in longProgression step 2L step 1L) { + longList += i + } + assertEquals(listOf(1L, 2L, 3L, 4L, 5L), longList) + + val charList = mutableListOf() + val charProgression = 'a'..'f' + for (i in charProgression step 2 step 1) { + charList += i + } + assertEquals(listOf('a', 'b', 'c', 'd', 'e'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepToSmallerLastThenStepToSameLast.kt b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepToSmallerLastThenStepToSameLast.kt new file mode 100644 index 00000000000..c4378c6c4b5 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepToSmallerLastThenStepToSameLast.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 1..8 + for (i in intProgression step 2 step 3) { + intList += i + } + assertEquals(listOf(1, 4, 7), intList) + + val longList = mutableListOf() + val longProgression = 1L..8L + for (i in longProgression step 2L step 3L) { + longList += i + } + assertEquals(listOf(1L, 4L, 7L), longList) + + val charList = mutableListOf() + val charProgression = 'a'..'h' + for (i in charProgression step 2 step 3) { + charList += i + } + assertEquals(listOf('a', 'd', 'g'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepToSmallerLastThenStepToSmallerLast.kt b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepToSmallerLastThenStepToSmallerLast.kt new file mode 100644 index 00000000000..ba326f079c1 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepToSmallerLastThenStepToSmallerLast.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 1..10 + for (i in intProgression step 2 step 3) { + intList += i + } + assertEquals(listOf(1, 4, 7), intList) + + val longList = mutableListOf() + val longProgression = 1L..10L + for (i in longProgression step 2L step 3L) { + longList += i + } + assertEquals(listOf(1L, 4L, 7L), longList) + + val charList = mutableListOf() + val charProgression = 'a'..'j' + for (i in charProgression step 2 step 3) { + charList += i + } + assertEquals(listOf('a', 'd', 'g'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/oneToMaxValueStepMaxValue.kt b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/oneToMaxValueStepMaxValue.kt new file mode 100644 index 00000000000..f9512e6e603 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/oneToMaxValueStepMaxValue.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 1..Int.MAX_VALUE + for (i in intProgression step Int.MAX_VALUE) { + intList += i + } + assertEquals(listOf(1), intList) + + val longList = mutableListOf() + val longProgression = 1L..Long.MAX_VALUE + for (i in longProgression step Long.MAX_VALUE) { + longList += i + } + assertEquals(listOf(1L), longList) + + val charList = mutableListOf() + val charProgression = 1.toChar()..Char.MAX_VALUE + for (i in charProgression step Char.MAX_VALUE.toInt()) { + charList += i + } + assertEquals(listOf(1.toChar()), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/reversed/reversedThenStep.kt b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/reversed/reversedThenStep.kt new file mode 100644 index 00000000000..7e860fb99c2 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/reversed/reversedThenStep.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 1..8 + for (i in intProgression.reversed() step 2) { + intList += i + } + assertEquals(listOf(8, 6, 4, 2), intList) + + val longList = mutableListOf() + val longProgression = 1L..8L + for (i in longProgression.reversed() step 2L) { + longList += i + } + assertEquals(listOf(8L, 6L, 4L, 2L), longList) + + val charList = mutableListOf() + val charProgression = 'a'..'h' + for (i in charProgression.reversed() step 2) { + charList += i + } + assertEquals(listOf('h', 'f', 'd', 'b'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/reversed/reversedThenStepThenReversed.kt b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/reversed/reversedThenStepThenReversed.kt new file mode 100644 index 00000000000..8705f5dcad9 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/reversed/reversedThenStepThenReversed.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 1..8 + for (i in (intProgression.reversed() step 2).reversed()) { + intList += i + } + assertEquals(listOf(2, 4, 6, 8), intList) + + val longList = mutableListOf() + val longProgression = 1L..8L + for (i in (longProgression.reversed() step 2L).reversed()) { + longList += i + } + assertEquals(listOf(2L, 4L, 6L, 8L), longList) + + val charList = mutableListOf() + val charProgression = 'a'..'h' + for (i in (charProgression.reversed() step 2).reversed()) { + charList += i + } + assertEquals(listOf('b', 'd', 'f', 'h'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/reversed/reversedThenStepThenReversedThenStep.kt b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/reversed/reversedThenStepThenReversedThenStep.kt new file mode 100644 index 00000000000..2759e413444 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/reversed/reversedThenStepThenReversedThenStep.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 1..10 + for (i in (intProgression.reversed() step 2).reversed() step 3) { + intList += i + } + assertEquals(listOf(2, 5, 8), intList) + + val longList = mutableListOf() + val longProgression = 1L..10L + for (i in (longProgression.reversed() step 2L).reversed() step 3L) { + longList += i + } + assertEquals(listOf(2L, 5L, 8L), longList) + + val charList = mutableListOf() + val charProgression = 'a'..'j' + for (i in (charProgression.reversed() step 2).reversed() step 3) { + charList += i + } + assertEquals(listOf('b', 'e', 'h'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/reversed/stepThenReversed.kt b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/reversed/stepThenReversed.kt new file mode 100644 index 00000000000..096268f36dc --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/reversed/stepThenReversed.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 1..8 + for (i in (intProgression step 2).reversed()) { + intList += i + } + assertEquals(listOf(7, 5, 3, 1), intList) + + val longList = mutableListOf() + val longProgression = 1L..8L + for (i in (longProgression step 2L).reversed()) { + longList += i + } + assertEquals(listOf(7L, 5L, 3L, 1L), longList) + + val charList = mutableListOf() + val charProgression = 'a'..'h' + for (i in (charProgression step 2).reversed()) { + charList += i + } + assertEquals(listOf('g', 'e', 'c', 'a'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/reversed/stepThenReversedThenStep.kt b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/reversed/stepThenReversedThenStep.kt new file mode 100644 index 00000000000..c3863429c3b --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/reversed/stepThenReversedThenStep.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 1..10 + for (i in (intProgression step 2).reversed() step 3) { + intList += i + } + assertEquals(listOf(9, 6, 3), intList) + + val longList = mutableListOf() + val longProgression = 1L..10L + for (i in (longProgression step 2L).reversed() step 3L) { + longList += i + } + assertEquals(listOf(9L, 6L, 3L), longList) + + val charList = mutableListOf() + val charProgression = 'a'..'j' + for (i in (charProgression step 2).reversed() step 3) { + charList += i + } + assertEquals(listOf('i', 'f', 'c'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/reversed/stepThenReversedThenStepThenReversed.kt b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/reversed/stepThenReversedThenStepThenReversed.kt new file mode 100644 index 00000000000..793f76eb127 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/reversed/stepThenReversedThenStepThenReversed.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 1..10 + for (i in ((intProgression step 2).reversed() step 3).reversed()) { + intList += i + } + assertEquals(listOf(3, 6, 9), intList) + + val longList = mutableListOf() + val longProgression = 1L..10L + for (i in ((longProgression step 2L).reversed() step 3L).reversed()) { + longList += i + } + assertEquals(listOf(3L, 6L, 9L), longList) + + val charList = mutableListOf() + val charProgression = 'a'..'j' + for (i in ((charProgression step 2).reversed() step 3).reversed()) { + charList += i + } + assertEquals(listOf('c', 'f', 'i'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/singleElementStepTwo.kt b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/singleElementStepTwo.kt new file mode 100644 index 00000000000..79d342aec7e --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/singleElementStepTwo.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 1..1 + for (i in intProgression step 2) { + intList += i + } + assertEquals(listOf(1), intList) + + val longList = mutableListOf() + val longProgression = 1L..1L + for (i in longProgression step 2L) { + longList += i + } + assertEquals(listOf(1L), longList) + + val charList = mutableListOf() + val charProgression = 'a'..'a' + for (i in charProgression step 2) { + charList += i + } + assertEquals(listOf('a'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/stepNonConst.kt b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/stepNonConst.kt new file mode 100644 index 00000000000..045aed5a180 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/stepNonConst.kt @@ -0,0 +1,30 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun two() = 2 + +fun box(): String { + val intList = mutableListOf() + val intProgression = 1..8 + for (i in intProgression step two()) { + intList += i + } + assertEquals(listOf(1, 3, 5, 7), intList) + + val longList = mutableListOf() + val longProgression = 1L..8L + for (i in longProgression step two().toLong()) { + longList += i + } + assertEquals(listOf(1L, 3L, 5L, 7L), longList) + + val charList = mutableListOf() + val charProgression = 'a'..'h' + for (i in charProgression step two()) { + charList += i + } + assertEquals(listOf('a', 'c', 'e', 'g'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/stepOne.kt b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/stepOne.kt new file mode 100644 index 00000000000..38b5022689c --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/stepOne.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 1..4 + for (i in intProgression step 1) { + intList += i + } + assertEquals(listOf(1, 2, 3, 4), intList) + + val longList = mutableListOf() + val longProgression = 1L..4L + for (i in longProgression step 1L) { + longList += i + } + assertEquals(listOf(1L, 2L, 3L, 4L), longList) + + val charList = mutableListOf() + val charProgression = 'a'..'d' + for (i in charProgression step 1) { + charList += i + } + assertEquals(listOf('a', 'b', 'c', 'd'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/stepToOutsideRange.kt b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/stepToOutsideRange.kt new file mode 100644 index 00000000000..7084ff58119 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/stepToOutsideRange.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 1..7 + for (i in intProgression step 7) { + intList += i + } + assertEquals(listOf(1), intList) + + val longList = mutableListOf() + val longProgression = 1L..7L + for (i in longProgression step 7L) { + longList += i + } + assertEquals(listOf(1L), longList) + + val charList = mutableListOf() + val charProgression = 'a'..'g' + for (i in charProgression step 7) { + charList += i + } + assertEquals(listOf('a'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/stepToSameLast.kt b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/stepToSameLast.kt new file mode 100644 index 00000000000..304e580b9e2 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/stepToSameLast.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 1..7 + for (i in intProgression step 2) { + intList += i + } + assertEquals(listOf(1, 3, 5, 7), intList) + + val longList = mutableListOf() + val longProgression = 1L..7L + for (i in longProgression step 2L) { + longList += i + } + assertEquals(listOf(1L, 3L, 5L, 7L), longList) + + val charList = mutableListOf() + val charProgression = 'a'..'g' + for (i in charProgression step 2) { + charList += i + } + assertEquals(listOf('a', 'c', 'e', 'g'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/stepToSmallerLast.kt b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/stepToSmallerLast.kt new file mode 100644 index 00000000000..c6319cb0922 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/stepToSmallerLast.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 1..8 + for (i in intProgression step 2) { + intList += i + } + assertEquals(listOf(1, 3, 5, 7), intList) + + val longList = mutableListOf() + val longProgression = 1L..8L + for (i in longProgression step 2L) { + longList += i + } + assertEquals(listOf(1L, 3L, 5L, 7L), longList) + + val charList = mutableListOf() + val charProgression = 'a'..'h' + for (i in charProgression step 2) { + charList += i + } + assertEquals(listOf('a', 'c', 'e', 'g'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/zeroToMaxValueStepMaxValue.kt b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/zeroToMaxValueStepMaxValue.kt new file mode 100644 index 00000000000..0f04c30efc4 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/zeroToMaxValueStepMaxValue.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 0..Int.MAX_VALUE + for (i in intProgression step Int.MAX_VALUE) { + intList += i + } + assertEquals(listOf(0, Int.MAX_VALUE), intList) + + val longList = mutableListOf() + val longProgression = 0L..Long.MAX_VALUE + for (i in longProgression step Long.MAX_VALUE) { + longList += i + } + assertEquals(listOf(0L, Long.MAX_VALUE), longList) + + val charList = mutableListOf() + val charProgression = 0.toChar()..Char.MAX_VALUE + for (i in charProgression step Char.MAX_VALUE.toInt()) { + charList += i + } + assertEquals(listOf(0.toChar(), Char.MAX_VALUE), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/until/emptyProgression.kt b/compiler/testData/codegen/box/ranges/stepped/expression/until/emptyProgression.kt new file mode 100644 index 00000000000..c4e40615b43 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/until/emptyProgression.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 2 until 2 + for (i in intProgression step 2) { + intList += i + } + assertTrue(intList.isEmpty()) + + val longList = mutableListOf() + val longProgression = 2L until 2L + for (i in longProgression step 2L) { + longList += i + } + assertTrue(longList.isEmpty()) + + val charList = mutableListOf() + val charProgression = 'b' until 'b' + for (i in charProgression step 2) { + charList += i + } + assertTrue(charList.isEmpty()) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/until/emptyProgressionToMinValue.kt b/compiler/testData/codegen/box/ranges/stepped/expression/until/emptyProgressionToMinValue.kt new file mode 100644 index 00000000000..7012e652ac6 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/until/emptyProgressionToMinValue.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 2 until Int.MIN_VALUE + for (i in intProgression step 2) { + intList += i + } + assertTrue(intList.isEmpty()) + + val longList = mutableListOf() + val longProgression = 2L until Long.MIN_VALUE + for (i in longProgression step 2L) { + longList += i + } + assertTrue(longList.isEmpty()) + + val charList = mutableListOf() + val charProgression = 'b' until Char.MIN_VALUE + for (i in charProgression step 2) { + charList += i + } + assertTrue(charList.isEmpty()) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/until/illegalStepNegative.kt b/compiler/testData/codegen/box/ranges/stepped/expression/until/illegalStepNegative.kt new file mode 100644 index 00000000000..0fb9b36a135 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/until/illegalStepNegative.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + assertFailsWith { + val intProgression = 1 until 7 + for (i in intProgression step -1) { + } + } + + assertFailsWith { + val longProgression = 1L until 7L + for (i in longProgression step -1L) { + } + } + + assertFailsWith { + val charProgression = 'a' until 'g' + for (i in charProgression step -1) { + } + } + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/until/illegalStepNonConst.kt b/compiler/testData/codegen/box/ranges/stepped/expression/until/illegalStepNonConst.kt new file mode 100644 index 00000000000..7b1e0ad55e5 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/until/illegalStepNonConst.kt @@ -0,0 +1,27 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun zero() = 0 + +fun box(): String { + assertFailsWith { + val intProgression = 1 until 7 + for (i in intProgression step zero()) { + } + } + + assertFailsWith { + val longProgression = 1L until 7L + for (i in longProgression step zero().toLong()) { + } + } + + assertFailsWith { + val charProgression = 'a' until 'g' + for (i in charProgression step zero()) { + } + } + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/until/illegalStepThenLegalStep.kt b/compiler/testData/codegen/box/ranges/stepped/expression/until/illegalStepThenLegalStep.kt new file mode 100644 index 00000000000..7c6c17f105d --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/until/illegalStepThenLegalStep.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + assertFailsWith { + val intProgression = 1 until 7 + for (i in intProgression step 0 step 2) { + } + } + + assertFailsWith { + val longProgression = 1L until 7L + for (i in longProgression step 0L step 2L) { + } + } + + assertFailsWith { + val charProgression = 'a' until 'g' + for (i in charProgression step 0 step 2) { + } + } + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/until/illegalStepZero.kt b/compiler/testData/codegen/box/ranges/stepped/expression/until/illegalStepZero.kt new file mode 100644 index 00000000000..59b96e0f5ae --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/until/illegalStepZero.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + assertFailsWith { + val intProgression = 1 until 7 + for (i in intProgression step 0) { + } + } + + assertFailsWith { + val longProgression = 1L until 7L + for (i in longProgression step 0L) { + } + } + + assertFailsWith { + val charProgression = 'a' until 'g' + for (i in charProgression step 0) { + } + } + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/until/legalStepThenIllegalStep.kt b/compiler/testData/codegen/box/ranges/stepped/expression/until/legalStepThenIllegalStep.kt new file mode 100644 index 00000000000..856fb4e3450 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/until/legalStepThenIllegalStep.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + assertFailsWith { + val intProgression = 1 until 7 + for (i in intProgression step 2 step 0) { + } + } + + assertFailsWith { + val longProgression = 1L until 7L + for (i in longProgression step 2L step 0L) { + } + } + + assertFailsWith { + val charProgression = 'a' until 'g' + for (i in charProgression step 2 step 0) { + } + } + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/until/minValueToMaxValueStepMaxValue.kt b/compiler/testData/codegen/box/ranges/stepped/expression/until/minValueToMaxValueStepMaxValue.kt new file mode 100644 index 00000000000..174f6444a03 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/until/minValueToMaxValueStepMaxValue.kt @@ -0,0 +1,21 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = Int.MIN_VALUE until Int.MAX_VALUE + for (i in intProgression step Int.MAX_VALUE) { + intList += i + } + assertEquals(listOf(Int.MIN_VALUE, -1, Int.MAX_VALUE - 1), intList) + + val longList = mutableListOf() + val longProgression = Long.MIN_VALUE until Long.MAX_VALUE + for (i in longProgression step Long.MAX_VALUE) { + longList += i + } + assertEquals(listOf(Long.MIN_VALUE, -1L, Long.MAX_VALUE - 1), longList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/until/mixedTypeStep.kt b/compiler/testData/codegen/box/ranges/stepped/expression/until/mixedTypeStep.kt new file mode 100644 index 00000000000..3a7c3db8c5f --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/until/mixedTypeStep.kt @@ -0,0 +1,21 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 1.toShort() until 8.toByte() + for (i in intProgression step 2) { + intList += i + } + assertEquals(listOf(1, 3, 5, 7), intList) + + val longList = mutableListOf() + val longProgression = 1L until 8 + for (i in longProgression step 2) { + longList += i + } + assertEquals(listOf(1L, 3L, 5L, 7L), longList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepOneThenStepOne.kt b/compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepOneThenStepOne.kt new file mode 100644 index 00000000000..e34153e327f --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepOneThenStepOne.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 1 until 5 + for (i in intProgression step 1 step 1) { + intList += i + } + assertEquals(listOf(1, 2, 3, 4), intList) + + val longList = mutableListOf() + val longProgression = 1L until 5L + for (i in longProgression step 1L step 1L) { + longList += i + } + assertEquals(listOf(1L, 2L, 3L, 4L), longList) + + val charList = mutableListOf() + val charProgression = 'a' until 'e' + for (i in charProgression step 1 step 1) { + charList += i + } + assertEquals(listOf('a', 'b', 'c', 'd'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepThenSameStep.kt b/compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepThenSameStep.kt new file mode 100644 index 00000000000..eafa28fb141 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepThenSameStep.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 1 until 9 + for (i in intProgression step 2 step 2) { + intList += i + } + assertEquals(listOf(1, 3, 5, 7), intList) + + val longList = mutableListOf() + val longProgression = 1L until 9L + for (i in longProgression step 2L step 2L) { + longList += i + } + assertEquals(listOf(1L, 3L, 5L, 7L), longList) + + val charList = mutableListOf() + val charProgression = 'a' until 'i' + for (i in charProgression step 2 step 2) { + charList += i + } + assertEquals(listOf('a', 'c', 'e', 'g'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepToSameLastThenStepOne.kt b/compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepToSameLastThenStepOne.kt new file mode 100644 index 00000000000..0acc77e0a54 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepToSameLastThenStepOne.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 1 until 6 + for (i in intProgression step 2 step 1) { + intList += i + } + assertEquals(listOf(1, 2, 3, 4, 5), intList) + + val longList = mutableListOf() + val longProgression = 1L until 6L + for (i in longProgression step 2L step 1L) { + longList += i + } + assertEquals(listOf(1L, 2L, 3L, 4L, 5L), longList) + + val charList = mutableListOf() + val charProgression = 'a' until 'f' + for (i in charProgression step 2 step 1) { + charList += i + } + assertEquals(listOf('a', 'b', 'c', 'd', 'e'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepToSameLastThenStepToSameLast.kt b/compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepToSameLastThenStepToSameLast.kt new file mode 100644 index 00000000000..b0206fa7d66 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepToSameLastThenStepToSameLast.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 1 until 8 + for (i in intProgression step 3 step 2) { + intList += i + } + assertEquals(listOf(1, 3, 5, 7), intList) + + val longList = mutableListOf() + val longProgression = 1L until 8L + for (i in longProgression step 3L step 2L) { + longList += i + } + assertEquals(listOf(1L, 3L, 5L, 7L), longList) + + val charList = mutableListOf() + val charProgression = 'a' until 'h' + for (i in charProgression step 3 step 2) { + charList += i + } + assertEquals(listOf('a', 'c', 'e', 'g'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepToSameLastThenStepToSmallerLast.kt b/compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepToSameLastThenStepToSmallerLast.kt new file mode 100644 index 00000000000..ac944622cc1 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepToSameLastThenStepToSmallerLast.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 1 until 11 + for (i in intProgression step 3 step 2) { + intList += i + } + assertEquals(listOf(1, 3, 5, 7, 9), intList) + + val longList = mutableListOf() + val longProgression = 1L until 11L + for (i in longProgression step 3L step 2L) { + longList += i + } + assertEquals(listOf(1L, 3L, 5L, 7L, 9L), longList) + + val charList = mutableListOf() + val charProgression = 'a' until 'k' + for (i in charProgression step 3 step 2) { + charList += i + } + assertEquals(listOf('a', 'c', 'e', 'g', 'i'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepToSmallerLastThenStepOne.kt b/compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepToSmallerLastThenStepOne.kt new file mode 100644 index 00000000000..be9152ef429 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepToSmallerLastThenStepOne.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 1 until 7 + for (i in intProgression step 2 step 1) { + intList += i + } + assertEquals(listOf(1, 2, 3, 4, 5), intList) + + val longList = mutableListOf() + val longProgression = 1L until 7L + for (i in longProgression step 2L step 1L) { + longList += i + } + assertEquals(listOf(1L, 2L, 3L, 4L, 5L), longList) + + val charList = mutableListOf() + val charProgression = 'a' until 'g' + for (i in charProgression step 2 step 1) { + charList += i + } + assertEquals(listOf('a', 'b', 'c', 'd', 'e'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepToSmallerLastThenStepToSameLast.kt b/compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepToSmallerLastThenStepToSameLast.kt new file mode 100644 index 00000000000..d8407ddb7ad --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepToSmallerLastThenStepToSameLast.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 1 until 9 + for (i in intProgression step 2 step 3) { + intList += i + } + assertEquals(listOf(1, 4, 7), intList) + + val longList = mutableListOf() + val longProgression = 1L until 9L + for (i in longProgression step 2L step 3L) { + longList += i + } + assertEquals(listOf(1L, 4L, 7L), longList) + + val charList = mutableListOf() + val charProgression = 'a' until 'i' + for (i in charProgression step 2 step 3) { + charList += i + } + assertEquals(listOf('a', 'd', 'g'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepToSmallerLastThenStepToSmallerLast.kt b/compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepToSmallerLastThenStepToSmallerLast.kt new file mode 100644 index 00000000000..57621695cc2 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepToSmallerLastThenStepToSmallerLast.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 1 until 11 + for (i in intProgression step 2 step 3) { + intList += i + } + assertEquals(listOf(1, 4, 7), intList) + + val longList = mutableListOf() + val longProgression = 1L until 11L + for (i in longProgression step 2L step 3L) { + longList += i + } + assertEquals(listOf(1L, 4L, 7L), longList) + + val charList = mutableListOf() + val charProgression = 'a' until 'k' + for (i in charProgression step 2 step 3) { + charList += i + } + assertEquals(listOf('a', 'd', 'g'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/until/reversed/reversedThenStep.kt b/compiler/testData/codegen/box/ranges/stepped/expression/until/reversed/reversedThenStep.kt new file mode 100644 index 00000000000..e99ef24a33d --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/until/reversed/reversedThenStep.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 1 until 9 + for (i in intProgression.reversed() step 2) { + intList += i + } + assertEquals(listOf(8, 6, 4, 2), intList) + + val longList = mutableListOf() + val longProgression = 1L until 9L + for (i in longProgression.reversed() step 2L) { + longList += i + } + assertEquals(listOf(8L, 6L, 4L, 2L), longList) + + val charList = mutableListOf() + val charProgression = 'a' until 'i' + for (i in charProgression.reversed() step 2) { + charList += i + } + assertEquals(listOf('h', 'f', 'd', 'b'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/until/reversed/reversedThenStepThenReversed.kt b/compiler/testData/codegen/box/ranges/stepped/expression/until/reversed/reversedThenStepThenReversed.kt new file mode 100644 index 00000000000..c367b9ff809 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/until/reversed/reversedThenStepThenReversed.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 1 until 9 + for (i in (intProgression.reversed() step 2).reversed()) { + intList += i + } + assertEquals(listOf(2, 4, 6, 8), intList) + + val longList = mutableListOf() + val longProgression = 1L until 9L + for (i in (longProgression.reversed() step 2L).reversed()) { + longList += i + } + assertEquals(listOf(2L, 4L, 6L, 8L), longList) + + val charList = mutableListOf() + val charProgression = 'a' until 'i' + for (i in (charProgression.reversed() step 2).reversed()) { + charList += i + } + assertEquals(listOf('b', 'd', 'f', 'h'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/until/reversed/reversedThenStepThenReversedThenStep.kt b/compiler/testData/codegen/box/ranges/stepped/expression/until/reversed/reversedThenStepThenReversedThenStep.kt new file mode 100644 index 00000000000..098fccd3204 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/until/reversed/reversedThenStepThenReversedThenStep.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 1 until 11 + for (i in (intProgression.reversed() step 2).reversed() step 3) { + intList += i + } + assertEquals(listOf(2, 5, 8), intList) + + val longList = mutableListOf() + val longProgression = 1L until 11L + for (i in (longProgression.reversed() step 2L).reversed() step 3L) { + longList += i + } + assertEquals(listOf(2L, 5L, 8L), longList) + + val charList = mutableListOf() + val charProgression = 'a' until 'k' + for (i in (charProgression.reversed() step 2).reversed() step 3) { + charList += i + } + assertEquals(listOf('b', 'e', 'h'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/until/reversed/stepThenReversed.kt b/compiler/testData/codegen/box/ranges/stepped/expression/until/reversed/stepThenReversed.kt new file mode 100644 index 00000000000..f81cc8f9f6c --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/until/reversed/stepThenReversed.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 1 until 9 + for (i in (intProgression step 2).reversed()) { + intList += i + } + assertEquals(listOf(7, 5, 3, 1), intList) + + val longList = mutableListOf() + val longProgression = 1L until 9L + for (i in (longProgression step 2L).reversed()) { + longList += i + } + assertEquals(listOf(7L, 5L, 3L, 1L), longList) + + val charList = mutableListOf() + val charProgression = 'a' until 'i' + for (i in (charProgression step 2).reversed()) { + charList += i + } + assertEquals(listOf('g', 'e', 'c', 'a'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/until/reversed/stepThenReversedThenStep.kt b/compiler/testData/codegen/box/ranges/stepped/expression/until/reversed/stepThenReversedThenStep.kt new file mode 100644 index 00000000000..0616c2713d0 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/until/reversed/stepThenReversedThenStep.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 1 until 11 + for (i in (intProgression step 2).reversed() step 3) { + intList += i + } + assertEquals(listOf(9, 6, 3), intList) + + val longList = mutableListOf() + val longProgression = 1L until 11L + for (i in (longProgression step 2L).reversed() step 3L) { + longList += i + } + assertEquals(listOf(9L, 6L, 3L), longList) + + val charList = mutableListOf() + val charProgression = 'a' until 'k' + for (i in (charProgression step 2).reversed() step 3) { + charList += i + } + assertEquals(listOf('i', 'f', 'c'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/until/reversed/stepThenReversedThenStepThenReversed.kt b/compiler/testData/codegen/box/ranges/stepped/expression/until/reversed/stepThenReversedThenStepThenReversed.kt new file mode 100644 index 00000000000..3d511c50375 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/until/reversed/stepThenReversedThenStepThenReversed.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 1 until 11 + for (i in ((intProgression step 2).reversed() step 3).reversed()) { + intList += i + } + assertEquals(listOf(3, 6, 9), intList) + + val longList = mutableListOf() + val longProgression = 1L until 11L + for (i in ((longProgression step 2L).reversed() step 3L).reversed()) { + longList += i + } + assertEquals(listOf(3L, 6L, 9L), longList) + + val charList = mutableListOf() + val charProgression = 'a' until 'k' + for (i in ((charProgression step 2).reversed() step 3).reversed()) { + charList += i + } + assertEquals(listOf('c', 'f', 'i'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/until/singleElementStepTwo.kt b/compiler/testData/codegen/box/ranges/stepped/expression/until/singleElementStepTwo.kt new file mode 100644 index 00000000000..e313f1a2a25 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/until/singleElementStepTwo.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 1 until 2 + for (i in intProgression step 2) { + intList += i + } + assertEquals(listOf(1), intList) + + val longList = mutableListOf() + val longProgression = 1L until 2L + for (i in longProgression step 2L) { + longList += i + } + assertEquals(listOf(1L), longList) + + val charList = mutableListOf() + val charProgression = 'a' until 'b' + for (i in charProgression step 2) { + charList += i + } + assertEquals(listOf('a'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/until/stepNonConst.kt b/compiler/testData/codegen/box/ranges/stepped/expression/until/stepNonConst.kt new file mode 100644 index 00000000000..5073568ca8c --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/until/stepNonConst.kt @@ -0,0 +1,30 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun two() = 2 + +fun box(): String { + val intList = mutableListOf() + val intProgression = 1 until 9 + for (i in intProgression step two()) { + intList += i + } + assertEquals(listOf(1, 3, 5, 7), intList) + + val longList = mutableListOf() + val longProgression = 1L until 9L + for (i in longProgression step two().toLong()) { + longList += i + } + assertEquals(listOf(1L, 3L, 5L, 7L), longList) + + val charList = mutableListOf() + val charProgression = 'a' until 'i' + for (i in charProgression step two()) { + charList += i + } + assertEquals(listOf('a', 'c', 'e', 'g'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/until/stepOne.kt b/compiler/testData/codegen/box/ranges/stepped/expression/until/stepOne.kt new file mode 100644 index 00000000000..76af41c9266 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/until/stepOne.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 1 until 5 + for (i in intProgression step 1) { + intList += i + } + assertEquals(listOf(1, 2, 3, 4), intList) + + val longList = mutableListOf() + val longProgression = 1L until 5L + for (i in longProgression step 1L) { + longList += i + } + assertEquals(listOf(1L, 2L, 3L, 4L), longList) + + val charList = mutableListOf() + val charProgression = 'a' until 'e' + for (i in charProgression step 1) { + charList += i + } + assertEquals(listOf('a', 'b', 'c', 'd'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/until/stepToOutsideRange.kt b/compiler/testData/codegen/box/ranges/stepped/expression/until/stepToOutsideRange.kt new file mode 100644 index 00000000000..9a2eee91ec9 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/until/stepToOutsideRange.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 1 until 8 + for (i in intProgression step 7) { + intList += i + } + assertEquals(listOf(1), intList) + + val longList = mutableListOf() + val longProgression = 1L until 8L + for (i in longProgression step 7L) { + longList += i + } + assertEquals(listOf(1L), longList) + + val charList = mutableListOf() + val charProgression = 'a' until 'h' + for (i in charProgression step 7) { + charList += i + } + assertEquals(listOf('a'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/until/stepToSameLast.kt b/compiler/testData/codegen/box/ranges/stepped/expression/until/stepToSameLast.kt new file mode 100644 index 00000000000..a4adad3706b --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/until/stepToSameLast.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 1 until 8 + for (i in intProgression step 2) { + intList += i + } + assertEquals(listOf(1, 3, 5, 7), intList) + + val longList = mutableListOf() + val longProgression = 1L until 8L + for (i in longProgression step 2L) { + longList += i + } + assertEquals(listOf(1L, 3L, 5L, 7L), longList) + + val charList = mutableListOf() + val charProgression = 'a' until 'h' + for (i in charProgression step 2) { + charList += i + } + assertEquals(listOf('a', 'c', 'e', 'g'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/until/stepToSmallerLast.kt b/compiler/testData/codegen/box/ranges/stepped/expression/until/stepToSmallerLast.kt new file mode 100644 index 00000000000..8043d556268 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/until/stepToSmallerLast.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 1 until 9 + for (i in intProgression step 2) { + intList += i + } + assertEquals(listOf(1, 3, 5, 7), intList) + + val longList = mutableListOf() + val longProgression = 1L until 9L + for (i in longProgression step 2L) { + longList += i + } + assertEquals(listOf(1L, 3L, 5L, 7L), longList) + + val charList = mutableListOf() + val charProgression = 'a' until 'i' + for (i in charProgression step 2) { + charList += i + } + assertEquals(listOf('a', 'c', 'e', 'g'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/expression/until/zeroToMaxValueStepMaxValue.kt b/compiler/testData/codegen/box/ranges/stepped/expression/until/zeroToMaxValueStepMaxValue.kt new file mode 100644 index 00000000000..cbbb6b1935e --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/expression/until/zeroToMaxValueStepMaxValue.kt @@ -0,0 +1,28 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + val intProgression = 0 until Int.MAX_VALUE + for (i in intProgression step Int.MAX_VALUE) { + intList += i + } + assertEquals(listOf(0), intList) + + val longList = mutableListOf() + val longProgression = 0L until Long.MAX_VALUE + for (i in longProgression step Long.MAX_VALUE) { + longList += i + } + assertEquals(listOf(0L), longList) + + val charList = mutableListOf() + val charProgression = 0.toChar() until Char.MAX_VALUE + for (i in charProgression step Char.MAX_VALUE.toInt()) { + charList += i + } + assertEquals(listOf(0.toChar()), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/downTo/emptyProgression.kt b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/emptyProgression.kt new file mode 100644 index 00000000000..35077b3ff00 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/emptyProgression.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in 1 downTo 2 step 2) { + intList += i + } + assertTrue(intList.isEmpty()) + + val longList = mutableListOf() + for (i in 1L downTo 2L step 2L) { + longList += i + } + assertTrue(longList.isEmpty()) + + val charList = mutableListOf() + for (i in 'a' downTo 'b' step 2) { + charList += i + } + assertTrue(charList.isEmpty()) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/downTo/illegalStepNegative.kt b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/illegalStepNegative.kt new file mode 100644 index 00000000000..70a68fb59ae --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/illegalStepNegative.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME + +// Bug in JS: Translation of loop over literal completely removes the validation of step +// DONT_TARGET_EXACT_BACKEND: JS +import kotlin.test.* + +fun box(): String { + assertFailsWith { + for (i in 7 downTo 1 step -1) { + } + } + + assertFailsWith { + for (i in 7L downTo 1L step -1L) { + } + } + + assertFailsWith { + for (i in 'g' downTo 'a' step -1) { + } + } + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/downTo/illegalStepNonConst.kt b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/illegalStepNonConst.kt new file mode 100644 index 00000000000..31d02054698 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/illegalStepNonConst.kt @@ -0,0 +1,27 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME + +// Bug in JS: Translation of loop over literal completely removes the validation of step +// DONT_TARGET_EXACT_BACKEND: JS +import kotlin.test.* + +fun zero() = 0 + +fun box(): String { + assertFailsWith { + for (i in 7 downTo 1 step zero()) { + } + } + + assertFailsWith { + for (i in 7L downTo 1L step zero().toLong()) { + } + } + + assertFailsWith { + for (i in 'g' downTo 'a' step zero()) { + } + } + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/downTo/illegalStepThenLegalStep.kt b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/illegalStepThenLegalStep.kt new file mode 100644 index 00000000000..39bc4cdd312 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/illegalStepThenLegalStep.kt @@ -0,0 +1,22 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + assertFailsWith { + for (i in 7 downTo 1 step 0 step 2) { + } + } + + assertFailsWith { + for (i in 7L downTo 1L step 0L step 2L) { + } + } + + assertFailsWith { + for (i in 'g' downTo 'a' step 0 step 2) { + } + } + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/downTo/illegalStepZero.kt b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/illegalStepZero.kt new file mode 100644 index 00000000000..96dd2d26c8e --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/illegalStepZero.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME + +// Bug in JS: Translation of loop over literal completely removes the validation of step +// DONT_TARGET_EXACT_BACKEND: JS +import kotlin.test.* + +fun box(): String { + assertFailsWith { + for (i in 7 downTo 1 step 0) { + } + } + + assertFailsWith { + for (i in 7L downTo 1L step 0L) { + } + } + + assertFailsWith { + for (i in 'g' downTo 'a' step 0) { + } + } + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/downTo/legalStepThenIllegalStep.kt b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/legalStepThenIllegalStep.kt new file mode 100644 index 00000000000..a77baa5cbcc --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/legalStepThenIllegalStep.kt @@ -0,0 +1,22 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + assertFailsWith { + for (i in 7 downTo 1 step 2 step 0) { + } + } + + assertFailsWith { + for (i in 7L downTo 1L step 2L step 0L) { + } + } + + assertFailsWith { + for (i in 'g' downTo 'a' step 2 step 0) { + } + } + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/downTo/maxValueToMinValueStepMaxValue.kt b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/maxValueToMinValueStepMaxValue.kt new file mode 100644 index 00000000000..ee9e241594c --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/maxValueToMinValueStepMaxValue.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in Int.MAX_VALUE downTo Int.MIN_VALUE step Int.MAX_VALUE) { + intList += i + } + assertEquals(listOf(Int.MAX_VALUE, 0, Int.MIN_VALUE + 1), intList) + + val longList = mutableListOf() + for (i in Long.MAX_VALUE downTo Long.MIN_VALUE step Long.MAX_VALUE) { + longList += i + } + assertEquals(listOf(Long.MAX_VALUE, 0, Long.MIN_VALUE + 1), longList) + + val charList = mutableListOf() + for (i in Char.MAX_VALUE downTo Char.MIN_VALUE step Char.MAX_VALUE.toInt()) { + charList += i + } + assertEquals(listOf(Char.MAX_VALUE, Char.MIN_VALUE), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/downTo/maxValueToOneStepMaxValue.kt b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/maxValueToOneStepMaxValue.kt new file mode 100644 index 00000000000..bd0d3f4924b --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/maxValueToOneStepMaxValue.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in Int.MAX_VALUE downTo 1 step Int.MAX_VALUE) { + intList += i + } + assertEquals(listOf(Int.MAX_VALUE), intList) + + val longList = mutableListOf() + for (i in Long.MAX_VALUE downTo 1L step Long.MAX_VALUE) { + longList += i + } + assertEquals(listOf(Long.MAX_VALUE), longList) + + val charList = mutableListOf() + for (i in Char.MAX_VALUE downTo 1.toChar() step Char.MAX_VALUE.toInt()) { + charList += i + } + assertEquals(listOf(Char.MAX_VALUE), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/downTo/maxValueToZeroStepMaxValue.kt b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/maxValueToZeroStepMaxValue.kt new file mode 100644 index 00000000000..49a38288765 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/maxValueToZeroStepMaxValue.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in Int.MAX_VALUE downTo 0 step Int.MAX_VALUE) { + intList += i + } + assertEquals(listOf(Int.MAX_VALUE, 0), intList) + + val longList = mutableListOf() + for (i in Long.MAX_VALUE downTo 0L step Long.MAX_VALUE) { + longList += i + } + assertEquals(listOf(Long.MAX_VALUE, 0L), longList) + + val charList = mutableListOf() + for (i in Char.MAX_VALUE downTo 0.toChar() step Char.MAX_VALUE.toInt()) { + charList += i + } + assertEquals(listOf(Char.MAX_VALUE, 0.toChar()), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/downTo/mixedTypeStep.kt b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/mixedTypeStep.kt new file mode 100644 index 00000000000..f6e517f1fbd --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/mixedTypeStep.kt @@ -0,0 +1,19 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in 7.toByte() downTo 1.toShort() step 2) { + intList += i + } + assertEquals(listOf(7, 5, 3, 1), intList) + + val longList = mutableListOf() + for (i in 7 downTo 1L step 2) { + longList += i + } + assertEquals(listOf(7L, 5L, 3L, 1L), longList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepOneThenStepOne.kt b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepOneThenStepOne.kt new file mode 100644 index 00000000000..3e3ced89070 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepOneThenStepOne.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in 4 downTo 1 step 1 step 1) { + intList += i + } + assertEquals(listOf(4, 3, 2, 1), intList) + + val longList = mutableListOf() + for (i in 4L downTo 1L step 1L step 1L) { + longList += i + } + assertEquals(listOf(4L, 3L, 2L, 1L), longList) + + val charList = mutableListOf() + for (i in 'd' downTo 'a' step 1 step 1) { + charList += i + } + assertEquals(listOf('d', 'c', 'b', 'a'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepThenSameStep.kt b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepThenSameStep.kt new file mode 100644 index 00000000000..609ffae294a --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepThenSameStep.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in 8 downTo 1 step 2 step 2) { + intList += i + } + assertEquals(listOf(8, 6, 4, 2), intList) + + val longList = mutableListOf() + for (i in 8L downTo 1L step 2L step 2L) { + longList += i + } + assertEquals(listOf(8L, 6L, 4L, 2L), longList) + + val charList = mutableListOf() + for (i in 'h' downTo 'a' step 2 step 2) { + charList += i + } + assertEquals(listOf('h', 'f', 'd', 'b'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepToSameLastThenStepOne.kt b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepToSameLastThenStepOne.kt new file mode 100644 index 00000000000..3ed8be647fc --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepToSameLastThenStepOne.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in 5 downTo 1 step 2 step 1) { + intList += i + } + assertEquals(listOf(5, 4, 3, 2, 1), intList) + + val longList = mutableListOf() + for (i in 5L downTo 1L step 2L step 1L) { + longList += i + } + assertEquals(listOf(5L, 4L, 3L, 2L, 1L), longList) + + val charList = mutableListOf() + for (i in 'e' downTo 'a' step 2 step 1) { + charList += i + } + assertEquals(listOf('e', 'd', 'c', 'b', 'a'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepToSameLastThenStepToSameLast.kt b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepToSameLastThenStepToSameLast.kt new file mode 100644 index 00000000000..e6b71d8b601 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepToSameLastThenStepToSameLast.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in 7 downTo 1 step 3 step 2) { + intList += i + } + assertEquals(listOf(7, 5, 3, 1), intList) + + val longList = mutableListOf() + for (i in 7L downTo 1L step 3L step 2L) { + longList += i + } + assertEquals(listOf(7L, 5L, 3L, 1L), longList) + + val charList = mutableListOf() + for (i in 'g' downTo 'a' step 3 step 2) { + charList += i + } + assertEquals(listOf('g', 'e', 'c', 'a'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepToSameLastThenStepToSmallerLast.kt b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepToSameLastThenStepToSmallerLast.kt new file mode 100644 index 00000000000..977c325e381 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepToSameLastThenStepToSmallerLast.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in 10 downTo 1 step 3 step 2) { + intList += i + } + assertEquals(listOf(10, 8, 6, 4, 2), intList) + + val longList = mutableListOf() + for (i in 10L downTo 1L step 3L step 2L) { + longList += i + } + assertEquals(listOf(10L, 8L, 6L, 4L, 2L), longList) + + val charList = mutableListOf() + for (i in 'j' downTo 'a' step 3 step 2) { + charList += i + } + assertEquals(listOf('j', 'h', 'f', 'd', 'b'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepToSmallerLastThenStepOne.kt b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepToSmallerLastThenStepOne.kt new file mode 100644 index 00000000000..e57a663652a --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepToSmallerLastThenStepOne.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in 6 downTo 1 step 2 step 1) { + intList += i + } + assertEquals(listOf(6, 5, 4, 3, 2), intList) + + val longList = mutableListOf() + for (i in 6L downTo 1L step 2L step 1L) { + longList += i + } + assertEquals(listOf(6L, 5L, 4L, 3L, 2L), longList) + + val charList = mutableListOf() + for (i in 'f' downTo 'a' step 2 step 1) { + charList += i + } + assertEquals(listOf('f', 'e', 'd', 'c', 'b'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepToSmallerLastThenStepToSameLast.kt b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepToSmallerLastThenStepToSameLast.kt new file mode 100644 index 00000000000..72dfef96cbd --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepToSmallerLastThenStepToSameLast.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in 8 downTo 1 step 2 step 3) { + intList += i + } + assertEquals(listOf(8, 5, 2), intList) + + val longList = mutableListOf() + for (i in 8L downTo 1L step 2L step 3L) { + longList += i + } + assertEquals(listOf(8L, 5L, 2L), longList) + + val charList = mutableListOf() + for (i in 'h' downTo 'a' step 2 step 3) { + charList += i + } + assertEquals(listOf('h', 'e', 'b'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepToSmallerLastThenStepToSmallerLast.kt b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepToSmallerLastThenStepToSmallerLast.kt new file mode 100644 index 00000000000..ef0b585ac4a --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepToSmallerLastThenStepToSmallerLast.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in 10 downTo 1 step 2 step 3) { + intList += i + } + assertEquals(listOf(10, 7, 4), intList) + + val longList = mutableListOf() + for (i in 10L downTo 1L step 2L step 3L) { + longList += i + } + assertEquals(listOf(10L, 7L, 4L), longList) + + val charList = mutableListOf() + for (i in 'j' downTo 'a' step 2 step 3) { + charList += i + } + assertEquals(listOf('j', 'g', 'd'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/downTo/reversed/reversedThenStep.kt b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/reversed/reversedThenStep.kt new file mode 100644 index 00000000000..a02ac1e799f --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/reversed/reversedThenStep.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in (8 downTo 1).reversed() step 2) { + intList += i + } + assertEquals(listOf(1, 3, 5, 7), intList) + + val longList = mutableListOf() + for (i in (8L downTo 1L).reversed() step 2L) { + longList += i + } + assertEquals(listOf(1L, 3L, 5L, 7L), longList) + + val charList = mutableListOf() + for (i in ('h' downTo 'a').reversed() step 2) { + charList += i + } + assertEquals(listOf('a', 'c', 'e', 'g'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/downTo/reversed/reversedThenStepThenReversed.kt b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/reversed/reversedThenStepThenReversed.kt new file mode 100644 index 00000000000..1a65b80816d --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/reversed/reversedThenStepThenReversed.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in ((8 downTo 1).reversed() step 2).reversed()) { + intList += i + } + assertEquals(listOf(7, 5, 3, 1), intList) + + val longList = mutableListOf() + for (i in ((8L downTo 1L).reversed() step 2L).reversed()) { + longList += i + } + assertEquals(listOf(7L, 5L, 3L, 1L), longList) + + val charList = mutableListOf() + for (i in (('h' downTo 'a').reversed() step 2).reversed()) { + charList += i + } + assertEquals(listOf('g', 'e', 'c', 'a'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/downTo/reversed/reversedThenStepThenReversedThenStep.kt b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/reversed/reversedThenStepThenReversedThenStep.kt new file mode 100644 index 00000000000..47b6006406e --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/reversed/reversedThenStepThenReversedThenStep.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in ((10 downTo 1).reversed() step 2).reversed() step 3) { + intList += i + } + assertEquals(listOf(9, 6, 3), intList) + + val longList = mutableListOf() + for (i in ((10L downTo 1L).reversed() step 2L).reversed() step 3L) { + longList += i + } + assertEquals(listOf(9L, 6L, 3L), longList) + + val charList = mutableListOf() + for (i in (('j' downTo 'a').reversed() step 2).reversed() step 3) { + charList += i + } + assertEquals(listOf('i', 'f', 'c'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/downTo/reversed/stepThenReversed.kt b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/reversed/stepThenReversed.kt new file mode 100644 index 00000000000..521d398dd49 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/reversed/stepThenReversed.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in (8 downTo 1 step 2).reversed()) { + intList += i + } + assertEquals(listOf(2, 4, 6, 8), intList) + + val longList = mutableListOf() + for (i in (8L downTo 1L step 2L).reversed()) { + longList += i + } + assertEquals(listOf(2L, 4L, 6L, 8L), longList) + + val charList = mutableListOf() + for (i in ('h' downTo 'a' step 2).reversed()) { + charList += i + } + assertEquals(listOf('b', 'd', 'f', 'h'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/downTo/reversed/stepThenReversedThenStep.kt b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/reversed/stepThenReversedThenStep.kt new file mode 100644 index 00000000000..e8101fd765f --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/reversed/stepThenReversedThenStep.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in (10 downTo 1 step 2).reversed() step 3) { + intList += i + } + assertEquals(listOf(2, 5, 8), intList) + + val longList = mutableListOf() + for (i in (10L downTo 1L step 2L).reversed() step 3L) { + longList += i + } + assertEquals(listOf(2L, 5L, 8L), longList) + + val charList = mutableListOf() + for (i in ('j' downTo 'a' step 2).reversed() step 3) { + charList += i + } + assertEquals(listOf('b', 'e', 'h'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/downTo/reversed/stepThenReversedThenStepThenReversed.kt b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/reversed/stepThenReversedThenStepThenReversed.kt new file mode 100644 index 00000000000..943ba1429fb --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/reversed/stepThenReversedThenStepThenReversed.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in ((10 downTo 1 step 2).reversed() step 3).reversed()) { + intList += i + } + assertEquals(listOf(8, 5, 2), intList) + + val longList = mutableListOf() + for (i in ((10L downTo 1L step 2L).reversed() step 3L).reversed()) { + longList += i + } + assertEquals(listOf(8L, 5L, 2L), longList) + + val charList = mutableListOf() + for (i in (('j' downTo 'a' step 2).reversed() step 3).reversed()) { + charList += i + } + assertEquals(listOf('h', 'e', 'b'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/downTo/singleElementStepTwo.kt b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/singleElementStepTwo.kt new file mode 100644 index 00000000000..5791a120b9c --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/singleElementStepTwo.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in 1 downTo 1 step 2) { + intList += i + } + assertEquals(listOf(1), intList) + + val longList = mutableListOf() + for (i in 1L downTo 1L step 2L) { + longList += i + } + assertEquals(listOf(1L), longList) + + val charList = mutableListOf() + for (i in 'a' downTo 'a' step 2) { + charList += i + } + assertEquals(listOf('a'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/downTo/stepNonConst.kt b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/stepNonConst.kt new file mode 100644 index 00000000000..7319c71a87c --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/stepNonConst.kt @@ -0,0 +1,27 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun two() = 2 + +fun box(): String { + val intList = mutableListOf() + for (i in 8 downTo 1 step two()) { + intList += i + } + assertEquals(listOf(8, 6, 4, 2), intList) + + val longList = mutableListOf() + for (i in 8L downTo 1L step two().toLong()) { + longList += i + } + assertEquals(listOf(8L, 6L, 4L, 2L), longList) + + val charList = mutableListOf() + for (i in 'h' downTo 'a' step two()) { + charList += i + } + assertEquals(listOf('h', 'f', 'd', 'b'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/downTo/stepOne.kt b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/stepOne.kt new file mode 100644 index 00000000000..7d7121a4519 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/stepOne.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in 4 downTo 1 step 1) { + intList += i + } + assertEquals(listOf(4, 3, 2, 1), intList) + + val longList = mutableListOf() + for (i in 4L downTo 1L step 1L) { + longList += i + } + assertEquals(listOf(4L, 3L, 2L, 1L), longList) + + val charList = mutableListOf() + for (i in 'd' downTo 'a' step 1) { + charList += i + } + assertEquals(listOf('d', 'c', 'b', 'a'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/downTo/stepToOutsideRange.kt b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/stepToOutsideRange.kt new file mode 100644 index 00000000000..af939ddb18d --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/stepToOutsideRange.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in 7 downTo 1 step 7) { + intList += i + } + assertEquals(listOf(7), intList) + + val longList = mutableListOf() + for (i in 7L downTo 1L step 7L) { + longList += i + } + assertEquals(listOf(7L), longList) + + val charList = mutableListOf() + for (i in 'g' downTo 'a' step 7) { + charList += i + } + assertEquals(listOf('g'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/downTo/stepToSameLast.kt b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/stepToSameLast.kt new file mode 100644 index 00000000000..a68085ee2bf --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/stepToSameLast.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in 7 downTo 1 step 2) { + intList += i + } + assertEquals(listOf(7, 5, 3, 1), intList) + + val longList = mutableListOf() + for (i in 7L downTo 1L step 2L) { + longList += i + } + assertEquals(listOf(7L, 5L, 3L, 1L), longList) + + val charList = mutableListOf() + for (i in 'g' downTo 'a' step 2) { + charList += i + } + assertEquals(listOf('g', 'e', 'c', 'a'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/downTo/stepToSmallerLast.kt b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/stepToSmallerLast.kt new file mode 100644 index 00000000000..5c53fa504b3 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/downTo/stepToSmallerLast.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in 8 downTo 1 step 2) { + intList += i + } + assertEquals(listOf(8, 6, 4, 2), intList) + + val longList = mutableListOf() + for (i in 8L downTo 1L step 2L) { + longList += i + } + assertEquals(listOf(8L, 6L, 4L, 2L), longList) + + val charList = mutableListOf() + for (i in 'h' downTo 'a' step 2) { + charList += i + } + assertEquals(listOf('h', 'f', 'd', 'b'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/emptyProgression.kt b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/emptyProgression.kt new file mode 100644 index 00000000000..f4a771e7ac0 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/emptyProgression.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in 2..1 step 2) { + intList += i + } + assertTrue(intList.isEmpty()) + + val longList = mutableListOf() + for (i in 2L..1L step 2L) { + longList += i + } + assertTrue(longList.isEmpty()) + + val charList = mutableListOf() + for (i in 'b'..'a' step 2) { + charList += i + } + assertTrue(charList.isEmpty()) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/illegalStepNegative.kt b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/illegalStepNegative.kt new file mode 100644 index 00000000000..5b337ea7e25 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/illegalStepNegative.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME + +// Bug in JS: Translation of loop over literal completely removes the validation of step +// DONT_TARGET_EXACT_BACKEND: JS +import kotlin.test.* + +fun box(): String { + assertFailsWith { + for (i in 1..7 step -1) { + } + } + + assertFailsWith { + for (i in 1L..7L step -1L) { + } + } + + assertFailsWith { + for (i in 'a'..'g' step -1) { + } + } + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/illegalStepNonConst.kt b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/illegalStepNonConst.kt new file mode 100644 index 00000000000..fb0896a8cd4 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/illegalStepNonConst.kt @@ -0,0 +1,27 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME + +// Bug in JS: Translation of loop over literal completely removes the validation of step +// DONT_TARGET_EXACT_BACKEND: JS +import kotlin.test.* + +fun zero() = 0 + +fun box(): String { + assertFailsWith { + for (i in 1..7 step zero()) { + } + } + + assertFailsWith { + for (i in 1L..7L step zero().toLong()) { + } + } + + assertFailsWith { + for (i in 'a'..'g' step zero()) { + } + } + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/illegalStepThenLegalStep.kt b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/illegalStepThenLegalStep.kt new file mode 100644 index 00000000000..7d2502768ea --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/illegalStepThenLegalStep.kt @@ -0,0 +1,22 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + assertFailsWith { + for (i in 1..7 step 0 step 2) { + } + } + + assertFailsWith { + for (i in 1L..7L step 0L step 2L) { + } + } + + assertFailsWith { + for (i in 'a'..'g' step 0 step 2) { + } + } + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/illegalStepZero.kt b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/illegalStepZero.kt new file mode 100644 index 00000000000..1116a90fe39 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/illegalStepZero.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME + +// Bug in JS: Translation of loop over literal completely removes the validation of step +// DONT_TARGET_EXACT_BACKEND: JS +import kotlin.test.* + +fun box(): String { + assertFailsWith { + for (i in 1..7 step 0) { + } + } + + assertFailsWith { + for (i in 1L..7L step 0L) { + } + } + + assertFailsWith { + for (i in 'a'..'g' step 0) { + } + } + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/legalStepThenIllegalStep.kt b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/legalStepThenIllegalStep.kt new file mode 100644 index 00000000000..d5d020a4fec --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/legalStepThenIllegalStep.kt @@ -0,0 +1,22 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + assertFailsWith { + for (i in 1..7 step 2 step 0) { + } + } + + assertFailsWith { + for (i in 1L..7L step 2L step 0L) { + } + } + + assertFailsWith { + for (i in 'a'..'g' step 2 step 0) { + } + } + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/minValueToMaxValueStepMaxValue.kt b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/minValueToMaxValueStepMaxValue.kt new file mode 100644 index 00000000000..35f327c92a8 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/minValueToMaxValueStepMaxValue.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in Int.MIN_VALUE..Int.MAX_VALUE step Int.MAX_VALUE) { + intList += i + } + assertEquals(listOf(Int.MIN_VALUE, -1, Int.MAX_VALUE - 1), intList) + + val longList = mutableListOf() + for (i in Long.MIN_VALUE..Long.MAX_VALUE step Long.MAX_VALUE) { + longList += i + } + assertEquals(listOf(Long.MIN_VALUE, -1L, Long.MAX_VALUE - 1), longList) + + val charList = mutableListOf() + for (i in Char.MIN_VALUE..Char.MAX_VALUE step Char.MAX_VALUE.toInt()) { + charList += i + } + assertEquals(listOf(Char.MIN_VALUE, Char.MAX_VALUE), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/mixedTypeStep.kt b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/mixedTypeStep.kt new file mode 100644 index 00000000000..e3f79c36a4e --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/mixedTypeStep.kt @@ -0,0 +1,19 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in 1.toShort()..7.toByte() step 2) { + intList += i + } + assertEquals(listOf(1, 3, 5, 7), intList) + + val longList = mutableListOf() + for (i in 1L..7 step 2) { + longList += i + } + assertEquals(listOf(1L, 3L, 5L, 7L), longList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepOneThenStepOne.kt b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepOneThenStepOne.kt new file mode 100644 index 00000000000..854d37ba9f5 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepOneThenStepOne.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in 1..4 step 1 step 1) { + intList += i + } + assertEquals(listOf(1, 2, 3, 4), intList) + + val longList = mutableListOf() + for (i in 1L..4L step 1L step 1L) { + longList += i + } + assertEquals(listOf(1L, 2L, 3L, 4L), longList) + + val charList = mutableListOf() + for (i in 'a'..'d' step 1 step 1) { + charList += i + } + assertEquals(listOf('a', 'b', 'c', 'd'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepThenSameStep.kt b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepThenSameStep.kt new file mode 100644 index 00000000000..0fe1fea8ebb --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepThenSameStep.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in 1..8 step 2 step 2) { + intList += i + } + assertEquals(listOf(1, 3, 5, 7), intList) + + val longList = mutableListOf() + for (i in 1L..8L step 2L step 2L) { + longList += i + } + assertEquals(listOf(1L, 3L, 5L, 7L), longList) + + val charList = mutableListOf() + for (i in 'a'..'h' step 2 step 2) { + charList += i + } + assertEquals(listOf('a', 'c', 'e', 'g'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepToSameLastThenStepOne.kt b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepToSameLastThenStepOne.kt new file mode 100644 index 00000000000..2f5aaba4821 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepToSameLastThenStepOne.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in 1..5 step 2 step 1) { + intList += i + } + assertEquals(listOf(1, 2, 3, 4, 5), intList) + + val longList = mutableListOf() + for (i in 1L..5L step 2L step 1L) { + longList += i + } + assertEquals(listOf(1L, 2L, 3L, 4L, 5L), longList) + + val charList = mutableListOf() + for (i in 'a'..'e' step 2 step 1) { + charList += i + } + assertEquals(listOf('a', 'b', 'c', 'd', 'e'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepToSameLastThenStepToSameLast.kt b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepToSameLastThenStepToSameLast.kt new file mode 100644 index 00000000000..3a21f7b0166 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepToSameLastThenStepToSameLast.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in 1..7 step 3 step 2) { + intList += i + } + assertEquals(listOf(1, 3, 5, 7), intList) + + val longList = mutableListOf() + for (i in 1L..7L step 3L step 2L) { + longList += i + } + assertEquals(listOf(1L, 3L, 5L, 7L), longList) + + val charList = mutableListOf() + for (i in 'a'..'g' step 3 step 2) { + charList += i + } + assertEquals(listOf('a', 'c', 'e', 'g'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepToSameLastThenStepToSmallerLast.kt b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepToSameLastThenStepToSmallerLast.kt new file mode 100644 index 00000000000..bea24aea8a3 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepToSameLastThenStepToSmallerLast.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in 1..10 step 3 step 2) { + intList += i + } + assertEquals(listOf(1, 3, 5, 7, 9), intList) + + val longList = mutableListOf() + for (i in 1L..10L step 3L step 2L) { + longList += i + } + assertEquals(listOf(1L, 3L, 5L, 7L, 9L), longList) + + val charList = mutableListOf() + for (i in 'a'..'j' step 3 step 2) { + charList += i + } + assertEquals(listOf('a', 'c', 'e', 'g', 'i'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepToSmallerLastThenStepOne.kt b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepToSmallerLastThenStepOne.kt new file mode 100644 index 00000000000..98b1538ff8b --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepToSmallerLastThenStepOne.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in 1..6 step 2 step 1) { + intList += i + } + assertEquals(listOf(1, 2, 3, 4, 5), intList) + + val longList = mutableListOf() + for (i in 1L..6L step 2L step 1L) { + longList += i + } + assertEquals(listOf(1L, 2L, 3L, 4L, 5L), longList) + + val charList = mutableListOf() + for (i in 'a'..'f' step 2 step 1) { + charList += i + } + assertEquals(listOf('a', 'b', 'c', 'd', 'e'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepToSmallerLastThenStepToSameLast.kt b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepToSmallerLastThenStepToSameLast.kt new file mode 100644 index 00000000000..27e813facb2 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepToSmallerLastThenStepToSameLast.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in 1..8 step 2 step 3) { + intList += i + } + assertEquals(listOf(1, 4, 7), intList) + + val longList = mutableListOf() + for (i in 1L..8L step 2L step 3L) { + longList += i + } + assertEquals(listOf(1L, 4L, 7L), longList) + + val charList = mutableListOf() + for (i in 'a'..'h' step 2 step 3) { + charList += i + } + assertEquals(listOf('a', 'd', 'g'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepToSmallerLastThenStepToSmallerLast.kt b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepToSmallerLastThenStepToSmallerLast.kt new file mode 100644 index 00000000000..bd34d32b176 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepToSmallerLastThenStepToSmallerLast.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in 1..10 step 2 step 3) { + intList += i + } + assertEquals(listOf(1, 4, 7), intList) + + val longList = mutableListOf() + for (i in 1L..10L step 2L step 3L) { + longList += i + } + assertEquals(listOf(1L, 4L, 7L), longList) + + val charList = mutableListOf() + for (i in 'a'..'j' step 2 step 3) { + charList += i + } + assertEquals(listOf('a', 'd', 'g'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/oneToMaxValueStepMaxValue.kt b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/oneToMaxValueStepMaxValue.kt new file mode 100644 index 00000000000..d8abf0b0623 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/oneToMaxValueStepMaxValue.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in 1..Int.MAX_VALUE step Int.MAX_VALUE) { + intList += i + } + assertEquals(listOf(1), intList) + + val longList = mutableListOf() + for (i in 1L..Long.MAX_VALUE step Long.MAX_VALUE) { + longList += i + } + assertEquals(listOf(1L), longList) + + val charList = mutableListOf() + for (i in 1.toChar()..Char.MAX_VALUE step Char.MAX_VALUE.toInt()) { + charList += i + } + assertEquals(listOf(1.toChar()), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/reversed/reversedThenStep.kt b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/reversed/reversedThenStep.kt new file mode 100644 index 00000000000..a701b06da21 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/reversed/reversedThenStep.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in (1..8).reversed() step 2) { + intList += i + } + assertEquals(listOf(8, 6, 4, 2), intList) + + val longList = mutableListOf() + for (i in (1L..8L).reversed() step 2L) { + longList += i + } + assertEquals(listOf(8L, 6L, 4L, 2L), longList) + + val charList = mutableListOf() + for (i in ('a'..'h').reversed() step 2) { + charList += i + } + assertEquals(listOf('h', 'f', 'd', 'b'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/reversed/reversedThenStepThenReversed.kt b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/reversed/reversedThenStepThenReversed.kt new file mode 100644 index 00000000000..a9415fec0f8 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/reversed/reversedThenStepThenReversed.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in ((1..8).reversed() step 2).reversed()) { + intList += i + } + assertEquals(listOf(2, 4, 6, 8), intList) + + val longList = mutableListOf() + for (i in ((1L..8L).reversed() step 2L).reversed()) { + longList += i + } + assertEquals(listOf(2L, 4L, 6L, 8L), longList) + + val charList = mutableListOf() + for (i in (('a'..'h').reversed() step 2).reversed()) { + charList += i + } + assertEquals(listOf('b', 'd', 'f', 'h'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/reversed/reversedThenStepThenReversedThenStep.kt b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/reversed/reversedThenStepThenReversedThenStep.kt new file mode 100644 index 00000000000..43cddf08940 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/reversed/reversedThenStepThenReversedThenStep.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in ((1..10).reversed() step 2).reversed() step 3) { + intList += i + } + assertEquals(listOf(2, 5, 8), intList) + + val longList = mutableListOf() + for (i in ((1L..10L).reversed() step 2L).reversed() step 3L) { + longList += i + } + assertEquals(listOf(2L, 5L, 8L), longList) + + val charList = mutableListOf() + for (i in (('a'..'j').reversed() step 2).reversed() step 3) { + charList += i + } + assertEquals(listOf('b', 'e', 'h'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/reversed/stepThenReversed.kt b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/reversed/stepThenReversed.kt new file mode 100644 index 00000000000..ad5617e538f --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/reversed/stepThenReversed.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in (1..8 step 2).reversed()) { + intList += i + } + assertEquals(listOf(7, 5, 3, 1), intList) + + val longList = mutableListOf() + for (i in (1L..8L step 2L).reversed()) { + longList += i + } + assertEquals(listOf(7L, 5L, 3L, 1L), longList) + + val charList = mutableListOf() + for (i in ('a'..'h' step 2).reversed()) { + charList += i + } + assertEquals(listOf('g', 'e', 'c', 'a'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/reversed/stepThenReversedThenStep.kt b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/reversed/stepThenReversedThenStep.kt new file mode 100644 index 00000000000..0eda8cba4ca --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/reversed/stepThenReversedThenStep.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in (1..10 step 2).reversed() step 3) { + intList += i + } + assertEquals(listOf(9, 6, 3), intList) + + val longList = mutableListOf() + for (i in (1L..10L step 2L).reversed() step 3L) { + longList += i + } + assertEquals(listOf(9L, 6L, 3L), longList) + + val charList = mutableListOf() + for (i in ('a'..'j' step 2).reversed() step 3) { + charList += i + } + assertEquals(listOf('i', 'f', 'c'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/reversed/stepThenReversedThenStepThenReversed.kt b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/reversed/stepThenReversedThenStepThenReversed.kt new file mode 100644 index 00000000000..1f73027c8b5 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/reversed/stepThenReversedThenStepThenReversed.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in ((1..10 step 2).reversed() step 3).reversed()) { + intList += i + } + assertEquals(listOf(3, 6, 9), intList) + + val longList = mutableListOf() + for (i in ((1L..10L step 2L).reversed() step 3L).reversed()) { + longList += i + } + assertEquals(listOf(3L, 6L, 9L), longList) + + val charList = mutableListOf() + for (i in (('a'..'j' step 2).reversed() step 3).reversed()) { + charList += i + } + assertEquals(listOf('c', 'f', 'i'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/singleElementStepTwo.kt b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/singleElementStepTwo.kt new file mode 100644 index 00000000000..a44e520d9c5 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/singleElementStepTwo.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in 1..1 step 2) { + intList += i + } + assertEquals(listOf(1), intList) + + val longList = mutableListOf() + for (i in 1L..1L step 2L) { + longList += i + } + assertEquals(listOf(1L), longList) + + val charList = mutableListOf() + for (i in 'a'..'a' step 2) { + charList += i + } + assertEquals(listOf('a'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/stepNonConst.kt b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/stepNonConst.kt new file mode 100644 index 00000000000..b523dec50b4 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/stepNonConst.kt @@ -0,0 +1,27 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun two() = 2 + +fun box(): String { + val intList = mutableListOf() + for (i in 1..8 step two()) { + intList += i + } + assertEquals(listOf(1, 3, 5, 7), intList) + + val longList = mutableListOf() + for (i in 1L..8L step two().toLong()) { + longList += i + } + assertEquals(listOf(1L, 3L, 5L, 7L), longList) + + val charList = mutableListOf() + for (i in 'a'..'h' step two()) { + charList += i + } + assertEquals(listOf('a', 'c', 'e', 'g'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/stepOne.kt b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/stepOne.kt new file mode 100644 index 00000000000..b3c39d39a35 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/stepOne.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in 1..4 step 1) { + intList += i + } + assertEquals(listOf(1, 2, 3, 4), intList) + + val longList = mutableListOf() + for (i in 1L..4L step 1L) { + longList += i + } + assertEquals(listOf(1L, 2L, 3L, 4L), longList) + + val charList = mutableListOf() + for (i in 'a'..'d' step 1) { + charList += i + } + assertEquals(listOf('a', 'b', 'c', 'd'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/stepToOutsideRange.kt b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/stepToOutsideRange.kt new file mode 100644 index 00000000000..ecde94825f3 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/stepToOutsideRange.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in 1..7 step 7) { + intList += i + } + assertEquals(listOf(1), intList) + + val longList = mutableListOf() + for (i in 1L..7L step 7L) { + longList += i + } + assertEquals(listOf(1L), longList) + + val charList = mutableListOf() + for (i in 'a'..'g' step 7) { + charList += i + } + assertEquals(listOf('a'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/stepToSameLast.kt b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/stepToSameLast.kt new file mode 100644 index 00000000000..c7b488b5df4 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/stepToSameLast.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in 1..7 step 2) { + intList += i + } + assertEquals(listOf(1, 3, 5, 7), intList) + + val longList = mutableListOf() + for (i in 1L..7L step 2L) { + longList += i + } + assertEquals(listOf(1L, 3L, 5L, 7L), longList) + + val charList = mutableListOf() + for (i in 'a'..'g' step 2) { + charList += i + } + assertEquals(listOf('a', 'c', 'e', 'g'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/stepToSmallerLast.kt b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/stepToSmallerLast.kt new file mode 100644 index 00000000000..356ccc98241 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/stepToSmallerLast.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in 1..8 step 2) { + intList += i + } + assertEquals(listOf(1, 3, 5, 7), intList) + + val longList = mutableListOf() + for (i in 1L..8L step 2L) { + longList += i + } + assertEquals(listOf(1L, 3L, 5L, 7L), longList) + + val charList = mutableListOf() + for (i in 'a'..'h' step 2) { + charList += i + } + assertEquals(listOf('a', 'c', 'e', 'g'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/zeroToMaxValueStepMaxValue.kt b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/zeroToMaxValueStepMaxValue.kt new file mode 100644 index 00000000000..a1ac2e4d49b --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/zeroToMaxValueStepMaxValue.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in 0..Int.MAX_VALUE step Int.MAX_VALUE) { + intList += i + } + assertEquals(listOf(0, Int.MAX_VALUE), intList) + + val longList = mutableListOf() + for (i in 0L..Long.MAX_VALUE step Long.MAX_VALUE) { + longList += i + } + assertEquals(listOf(0L, Long.MAX_VALUE), longList) + + val charList = mutableListOf() + for (i in 0.toChar()..Char.MAX_VALUE step Char.MAX_VALUE.toInt()) { + charList += i + } + assertEquals(listOf(0.toChar(), Char.MAX_VALUE), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/until/emptyProgression.kt b/compiler/testData/codegen/box/ranges/stepped/literal/until/emptyProgression.kt new file mode 100644 index 00000000000..bc0ec668890 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/until/emptyProgression.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in 2 until 2 step 2) { + intList += i + } + assertTrue(intList.isEmpty()) + + val longList = mutableListOf() + for (i in 2L until 2L step 2L) { + longList += i + } + assertTrue(longList.isEmpty()) + + val charList = mutableListOf() + for (i in 'b' until 'b' step 2) { + charList += i + } + assertTrue(charList.isEmpty()) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/until/emptyProgressionToMinValue.kt b/compiler/testData/codegen/box/ranges/stepped/literal/until/emptyProgressionToMinValue.kt new file mode 100644 index 00000000000..1d34a1bfa05 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/until/emptyProgressionToMinValue.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in 2 until Int.MIN_VALUE step 2) { + intList += i + } + assertTrue(intList.isEmpty()) + + val longList = mutableListOf() + for (i in 2L until Long.MIN_VALUE step 2L) { + longList += i + } + assertTrue(longList.isEmpty()) + + val charList = mutableListOf() + for (i in 'b' until Char.MIN_VALUE step 2) { + charList += i + } + assertTrue(charList.isEmpty()) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/until/illegalStepNegative.kt b/compiler/testData/codegen/box/ranges/stepped/literal/until/illegalStepNegative.kt new file mode 100644 index 00000000000..7017bcc5346 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/until/illegalStepNegative.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME + +// Bug in JS: Translation of loop over literal completely removes the validation of step +// DONT_TARGET_EXACT_BACKEND: JS +import kotlin.test.* + +fun box(): String { + assertFailsWith { + for (i in 1 until 7 step -1) { + } + } + + assertFailsWith { + for (i in 1L until 7L step -1L) { + } + } + + assertFailsWith { + for (i in 'a' until 'g' step -1) { + } + } + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/until/illegalStepNonConst.kt b/compiler/testData/codegen/box/ranges/stepped/literal/until/illegalStepNonConst.kt new file mode 100644 index 00000000000..dce07e149a5 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/until/illegalStepNonConst.kt @@ -0,0 +1,27 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME + +// Bug in JS: Translation of loop over literal completely removes the validation of step +// DONT_TARGET_EXACT_BACKEND: JS +import kotlin.test.* + +fun zero() = 0 + +fun box(): String { + assertFailsWith { + for (i in 1 until 7 step zero()) { + } + } + + assertFailsWith { + for (i in 1L until 7L step zero().toLong()) { + } + } + + assertFailsWith { + for (i in 'a' until 'g' step zero()) { + } + } + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/until/illegalStepThenLegalStep.kt b/compiler/testData/codegen/box/ranges/stepped/literal/until/illegalStepThenLegalStep.kt new file mode 100644 index 00000000000..e651bd03ef6 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/until/illegalStepThenLegalStep.kt @@ -0,0 +1,22 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + assertFailsWith { + for (i in 1 until 7 step 0 step 2) { + } + } + + assertFailsWith { + for (i in 1L until 7L step 0L step 2L) { + } + } + + assertFailsWith { + for (i in 'a' until 'g' step 0 step 2) { + } + } + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/until/illegalStepZero.kt b/compiler/testData/codegen/box/ranges/stepped/literal/until/illegalStepZero.kt new file mode 100644 index 00000000000..70b410a108a --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/until/illegalStepZero.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME + +// Bug in JS: Translation of loop over literal completely removes the validation of step +// DONT_TARGET_EXACT_BACKEND: JS +import kotlin.test.* + +fun box(): String { + assertFailsWith { + for (i in 1 until 7 step 0) { + } + } + + assertFailsWith { + for (i in 1L until 7L step 0L) { + } + } + + assertFailsWith { + for (i in 'a' until 'g' step 0) { + } + } + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/until/legalStepThenIllegalStep.kt b/compiler/testData/codegen/box/ranges/stepped/literal/until/legalStepThenIllegalStep.kt new file mode 100644 index 00000000000..3cd5ba7ec1b --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/until/legalStepThenIllegalStep.kt @@ -0,0 +1,22 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + assertFailsWith { + for (i in 1 until 7 step 2 step 0) { + } + } + + assertFailsWith { + for (i in 1L until 7L step 2L step 0L) { + } + } + + assertFailsWith { + for (i in 'a' until 'g' step 2 step 0) { + } + } + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/until/minValueToMaxValueStepMaxValue.kt b/compiler/testData/codegen/box/ranges/stepped/literal/until/minValueToMaxValueStepMaxValue.kt new file mode 100644 index 00000000000..721d0e57a16 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/until/minValueToMaxValueStepMaxValue.kt @@ -0,0 +1,19 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in Int.MIN_VALUE until Int.MAX_VALUE step Int.MAX_VALUE) { + intList += i + } + assertEquals(listOf(Int.MIN_VALUE, -1, Int.MAX_VALUE - 1), intList) + + val longList = mutableListOf() + for (i in Long.MIN_VALUE until Long.MAX_VALUE step Long.MAX_VALUE) { + longList += i + } + assertEquals(listOf(Long.MIN_VALUE, -1L, Long.MAX_VALUE - 1), longList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/until/mixedTypeStep.kt b/compiler/testData/codegen/box/ranges/stepped/literal/until/mixedTypeStep.kt new file mode 100644 index 00000000000..cbd47d25fbe --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/until/mixedTypeStep.kt @@ -0,0 +1,19 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in 1.toShort() until 8.toByte() step 2) { + intList += i + } + assertEquals(listOf(1, 3, 5, 7), intList) + + val longList = mutableListOf() + for (i in 1L until 8 step 2) { + longList += i + } + assertEquals(listOf(1L, 3L, 5L, 7L), longList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepOneThenStepOne.kt b/compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepOneThenStepOne.kt new file mode 100644 index 00000000000..45d1cb9f180 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepOneThenStepOne.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in 1 until 5 step 1 step 1) { + intList += i + } + assertEquals(listOf(1, 2, 3, 4), intList) + + val longList = mutableListOf() + for (i in 1L until 5L step 1L step 1L) { + longList += i + } + assertEquals(listOf(1L, 2L, 3L, 4L), longList) + + val charList = mutableListOf() + for (i in 'a' until 'e' step 1 step 1) { + charList += i + } + assertEquals(listOf('a', 'b', 'c', 'd'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepThenSameStep.kt b/compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepThenSameStep.kt new file mode 100644 index 00000000000..da37eceba95 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepThenSameStep.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in 1 until 9 step 2 step 2) { + intList += i + } + assertEquals(listOf(1, 3, 5, 7), intList) + + val longList = mutableListOf() + for (i in 1L until 9L step 2L step 2L) { + longList += i + } + assertEquals(listOf(1L, 3L, 5L, 7L), longList) + + val charList = mutableListOf() + for (i in 'a' until 'i' step 2 step 2) { + charList += i + } + assertEquals(listOf('a', 'c', 'e', 'g'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepToSameLastThenStepOne.kt b/compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepToSameLastThenStepOne.kt new file mode 100644 index 00000000000..8e4b6ecf98d --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepToSameLastThenStepOne.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in 1 until 6 step 2 step 1) { + intList += i + } + assertEquals(listOf(1, 2, 3, 4, 5), intList) + + val longList = mutableListOf() + for (i in 1L until 6L step 2L step 1L) { + longList += i + } + assertEquals(listOf(1L, 2L, 3L, 4L, 5L), longList) + + val charList = mutableListOf() + for (i in 'a' until 'f' step 2 step 1) { + charList += i + } + assertEquals(listOf('a', 'b', 'c', 'd', 'e'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepToSameLastThenStepToSameLast.kt b/compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepToSameLastThenStepToSameLast.kt new file mode 100644 index 00000000000..3c94a64b722 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepToSameLastThenStepToSameLast.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in 1 until 8 step 3 step 2) { + intList += i + } + assertEquals(listOf(1, 3, 5, 7), intList) + + val longList = mutableListOf() + for (i in 1L until 8L step 3L step 2L) { + longList += i + } + assertEquals(listOf(1L, 3L, 5L, 7L), longList) + + val charList = mutableListOf() + for (i in 'a' until 'h' step 3 step 2) { + charList += i + } + assertEquals(listOf('a', 'c', 'e', 'g'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepToSameLastThenStepToSmallerLast.kt b/compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepToSameLastThenStepToSmallerLast.kt new file mode 100644 index 00000000000..8bbac497c16 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepToSameLastThenStepToSmallerLast.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in 1 until 11 step 3 step 2) { + intList += i + } + assertEquals(listOf(1, 3, 5, 7, 9), intList) + + val longList = mutableListOf() + for (i in 1L until 11L step 3L step 2L) { + longList += i + } + assertEquals(listOf(1L, 3L, 5L, 7L, 9L), longList) + + val charList = mutableListOf() + for (i in 'a' until 'k' step 3 step 2) { + charList += i + } + assertEquals(listOf('a', 'c', 'e', 'g', 'i'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepToSmallerLastThenStepOne.kt b/compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepToSmallerLastThenStepOne.kt new file mode 100644 index 00000000000..b31f713db2a --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepToSmallerLastThenStepOne.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in 1 until 7 step 2 step 1) { + intList += i + } + assertEquals(listOf(1, 2, 3, 4, 5), intList) + + val longList = mutableListOf() + for (i in 1L until 7L step 2L step 1L) { + longList += i + } + assertEquals(listOf(1L, 2L, 3L, 4L, 5L), longList) + + val charList = mutableListOf() + for (i in 'a' until 'g' step 2 step 1) { + charList += i + } + assertEquals(listOf('a', 'b', 'c', 'd', 'e'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepToSmallerLastThenStepToSameLast.kt b/compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepToSmallerLastThenStepToSameLast.kt new file mode 100644 index 00000000000..588545d31ab --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepToSmallerLastThenStepToSameLast.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in 1 until 9 step 2 step 3) { + intList += i + } + assertEquals(listOf(1, 4, 7), intList) + + val longList = mutableListOf() + for (i in 1L until 9L step 2L step 3L) { + longList += i + } + assertEquals(listOf(1L, 4L, 7L), longList) + + val charList = mutableListOf() + for (i in 'a' until 'i' step 2 step 3) { + charList += i + } + assertEquals(listOf('a', 'd', 'g'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepToSmallerLastThenStepToSmallerLast.kt b/compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepToSmallerLastThenStepToSmallerLast.kt new file mode 100644 index 00000000000..006cb09df77 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepToSmallerLastThenStepToSmallerLast.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in 1 until 11 step 2 step 3) { + intList += i + } + assertEquals(listOf(1, 4, 7), intList) + + val longList = mutableListOf() + for (i in 1L until 11L step 2L step 3L) { + longList += i + } + assertEquals(listOf(1L, 4L, 7L), longList) + + val charList = mutableListOf() + for (i in 'a' until 'k' step 2 step 3) { + charList += i + } + assertEquals(listOf('a', 'd', 'g'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/until/progressionToNonConst.kt b/compiler/testData/codegen/box/ranges/stepped/literal/until/progressionToNonConst.kt new file mode 100644 index 00000000000..5b32df5fe38 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/until/progressionToNonConst.kt @@ -0,0 +1,27 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun nine() = 9 + +fun box(): String { + val intList = mutableListOf() + for (i in 1 until nine() step 2) { + intList += i + } + assertEquals(listOf(1, 3, 5, 7), intList) + + val longList = mutableListOf() + for (i in 1L until nine().toLong() step 2L) { + longList += i + } + assertEquals(listOf(1L, 3L, 5L, 7L), longList) + + val charList = mutableListOf() + for (i in 'a' until ('a' - 1 + nine()) step 2) { + charList += i + } + assertEquals(listOf('a', 'c', 'e', 'g'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/until/reversed/reversedThenStep.kt b/compiler/testData/codegen/box/ranges/stepped/literal/until/reversed/reversedThenStep.kt new file mode 100644 index 00000000000..d54ed6682e7 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/until/reversed/reversedThenStep.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in (1 until 9).reversed() step 2) { + intList += i + } + assertEquals(listOf(8, 6, 4, 2), intList) + + val longList = mutableListOf() + for (i in (1L until 9L).reversed() step 2L) { + longList += i + } + assertEquals(listOf(8L, 6L, 4L, 2L), longList) + + val charList = mutableListOf() + for (i in ('a' until 'i').reversed() step 2) { + charList += i + } + assertEquals(listOf('h', 'f', 'd', 'b'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/until/reversed/reversedThenStepThenReversed.kt b/compiler/testData/codegen/box/ranges/stepped/literal/until/reversed/reversedThenStepThenReversed.kt new file mode 100644 index 00000000000..36f95a41591 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/until/reversed/reversedThenStepThenReversed.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in ((1 until 9).reversed() step 2).reversed()) { + intList += i + } + assertEquals(listOf(2, 4, 6, 8), intList) + + val longList = mutableListOf() + for (i in ((1L until 9L).reversed() step 2L).reversed()) { + longList += i + } + assertEquals(listOf(2L, 4L, 6L, 8L), longList) + + val charList = mutableListOf() + for (i in (('a' until 'i').reversed() step 2).reversed()) { + charList += i + } + assertEquals(listOf('b', 'd', 'f', 'h'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/until/reversed/reversedThenStepThenReversedThenStep.kt b/compiler/testData/codegen/box/ranges/stepped/literal/until/reversed/reversedThenStepThenReversedThenStep.kt new file mode 100644 index 00000000000..5b39f87fd1a --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/until/reversed/reversedThenStepThenReversedThenStep.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in ((1 until 11).reversed() step 2).reversed() step 3) { + intList += i + } + assertEquals(listOf(2, 5, 8), intList) + + val longList = mutableListOf() + for (i in ((1L until 11L).reversed() step 2L).reversed() step 3L) { + longList += i + } + assertEquals(listOf(2L, 5L, 8L), longList) + + val charList = mutableListOf() + for (i in (('a' until 'k').reversed() step 2).reversed() step 3) { + charList += i + } + assertEquals(listOf('b', 'e', 'h'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/until/reversed/stepThenReversed.kt b/compiler/testData/codegen/box/ranges/stepped/literal/until/reversed/stepThenReversed.kt new file mode 100644 index 00000000000..59ecd4a1d60 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/until/reversed/stepThenReversed.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in (1 until 9 step 2).reversed()) { + intList += i + } + assertEquals(listOf(7, 5, 3, 1), intList) + + val longList = mutableListOf() + for (i in (1L until 9L step 2L).reversed()) { + longList += i + } + assertEquals(listOf(7L, 5L, 3L, 1L), longList) + + val charList = mutableListOf() + for (i in ('a' until 'i' step 2).reversed()) { + charList += i + } + assertEquals(listOf('g', 'e', 'c', 'a'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/until/reversed/stepThenReversedThenStep.kt b/compiler/testData/codegen/box/ranges/stepped/literal/until/reversed/stepThenReversedThenStep.kt new file mode 100644 index 00000000000..9949448dcde --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/until/reversed/stepThenReversedThenStep.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in (1 until 11 step 2).reversed() step 3) { + intList += i + } + assertEquals(listOf(9, 6, 3), intList) + + val longList = mutableListOf() + for (i in (1L until 11L step 2L).reversed() step 3L) { + longList += i + } + assertEquals(listOf(9L, 6L, 3L), longList) + + val charList = mutableListOf() + for (i in ('a' until 'k' step 2).reversed() step 3) { + charList += i + } + assertEquals(listOf('i', 'f', 'c'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/until/reversed/stepThenReversedThenStepThenReversed.kt b/compiler/testData/codegen/box/ranges/stepped/literal/until/reversed/stepThenReversedThenStepThenReversed.kt new file mode 100644 index 00000000000..35f4d59b7e6 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/until/reversed/stepThenReversedThenStepThenReversed.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in ((1 until 11 step 2).reversed() step 3).reversed()) { + intList += i + } + assertEquals(listOf(3, 6, 9), intList) + + val longList = mutableListOf() + for (i in ((1L until 11L step 2L).reversed() step 3L).reversed()) { + longList += i + } + assertEquals(listOf(3L, 6L, 9L), longList) + + val charList = mutableListOf() + for (i in (('a' until 'k' step 2).reversed() step 3).reversed()) { + charList += i + } + assertEquals(listOf('c', 'f', 'i'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/until/singleElementStepTwo.kt b/compiler/testData/codegen/box/ranges/stepped/literal/until/singleElementStepTwo.kt new file mode 100644 index 00000000000..7e743c2a368 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/until/singleElementStepTwo.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in 1 until 2 step 2) { + intList += i + } + assertEquals(listOf(1), intList) + + val longList = mutableListOf() + for (i in 1L until 2L step 2L) { + longList += i + } + assertEquals(listOf(1L), longList) + + val charList = mutableListOf() + for (i in 'a' until 'b' step 2) { + charList += i + } + assertEquals(listOf('a'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/until/stepNonConst.kt b/compiler/testData/codegen/box/ranges/stepped/literal/until/stepNonConst.kt new file mode 100644 index 00000000000..e0b3a50b2a0 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/until/stepNonConst.kt @@ -0,0 +1,27 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun two() = 2 + +fun box(): String { + val intList = mutableListOf() + for (i in 1 until 9 step two()) { + intList += i + } + assertEquals(listOf(1, 3, 5, 7), intList) + + val longList = mutableListOf() + for (i in 1L until 9L step two().toLong()) { + longList += i + } + assertEquals(listOf(1L, 3L, 5L, 7L), longList) + + val charList = mutableListOf() + for (i in 'a' until 'i' step two()) { + charList += i + } + assertEquals(listOf('a', 'c', 'e', 'g'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/until/stepOne.kt b/compiler/testData/codegen/box/ranges/stepped/literal/until/stepOne.kt new file mode 100644 index 00000000000..e9242aa66eb --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/until/stepOne.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in 1 until 5 step 1) { + intList += i + } + assertEquals(listOf(1, 2, 3, 4), intList) + + val longList = mutableListOf() + for (i in 1L until 5L step 1L) { + longList += i + } + assertEquals(listOf(1L, 2L, 3L, 4L), longList) + + val charList = mutableListOf() + for (i in 'a' until 'e' step 1) { + charList += i + } + assertEquals(listOf('a', 'b', 'c', 'd'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/until/stepToOutsideRange.kt b/compiler/testData/codegen/box/ranges/stepped/literal/until/stepToOutsideRange.kt new file mode 100644 index 00000000000..0396b8cd718 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/until/stepToOutsideRange.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in 1 until 8 step 7) { + intList += i + } + assertEquals(listOf(1), intList) + + val longList = mutableListOf() + for (i in 1L until 8L step 7L) { + longList += i + } + assertEquals(listOf(1L), longList) + + val charList = mutableListOf() + for (i in 'a' until 'h' step 7) { + charList += i + } + assertEquals(listOf('a'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/until/stepToSameLast.kt b/compiler/testData/codegen/box/ranges/stepped/literal/until/stepToSameLast.kt new file mode 100644 index 00000000000..63b3cb3e0c4 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/until/stepToSameLast.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in 1 until 8 step 2) { + intList += i + } + assertEquals(listOf(1, 3, 5, 7), intList) + + val longList = mutableListOf() + for (i in 1L until 8L step 2L) { + longList += i + } + assertEquals(listOf(1L, 3L, 5L, 7L), longList) + + val charList = mutableListOf() + for (i in 'a' until 'h' step 2) { + charList += i + } + assertEquals(listOf('a', 'c', 'e', 'g'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/until/stepToSmallerLast.kt b/compiler/testData/codegen/box/ranges/stepped/literal/until/stepToSmallerLast.kt new file mode 100644 index 00000000000..d8149c4022d --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/until/stepToSmallerLast.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in 1 until 9 step 2) { + intList += i + } + assertEquals(listOf(1, 3, 5, 7), intList) + + val longList = mutableListOf() + for (i in 1L until 9L step 2L) { + longList += i + } + assertEquals(listOf(1L, 3L, 5L, 7L), longList) + + val charList = mutableListOf() + for (i in 'a' until 'i' step 2) { + charList += i + } + assertEquals(listOf('a', 'c', 'e', 'g'), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/stepped/literal/until/zeroToMaxValueStepMaxValue.kt b/compiler/testData/codegen/box/ranges/stepped/literal/until/zeroToMaxValueStepMaxValue.kt new file mode 100644 index 00000000000..3db4ccda63d --- /dev/null +++ b/compiler/testData/codegen/box/ranges/stepped/literal/until/zeroToMaxValueStepMaxValue.kt @@ -0,0 +1,25 @@ +// KJS_WITH_FULL_RUNTIME +// WITH_RUNTIME +import kotlin.test.* + +fun box(): String { + val intList = mutableListOf() + for (i in 0 until Int.MAX_VALUE step Int.MAX_VALUE) { + intList += i + } + assertEquals(listOf(0), intList) + + val longList = mutableListOf() + for (i in 0L until Long.MAX_VALUE step Long.MAX_VALUE) { + longList += i + } + assertEquals(listOf(0L), longList) + + val charList = mutableListOf() + for (i in 0.toChar() until Char.MAX_VALUE step Char.MAX_VALUE.toInt()) { + charList += i + } + assertEquals(listOf(0.toChar()), charList) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/bytecodeText/forLoop/primitiveProgression.kt b/compiler/testData/codegen/bytecodeText/forLoop/primitiveProgression.kt index ec759232526..7dc3a511038 100644 --- a/compiler/testData/codegen/bytecodeText/forLoop/primitiveProgression.kt +++ b/compiler/testData/codegen/bytecodeText/forLoop/primitiveProgression.kt @@ -2,11 +2,61 @@ fun f() { for (i in 0..5 step 2) { } - for (i in 5 downTo 1 step 1) { // suppress optimized code generation for 'for-in-downTo' + // JVM non-IR: `step 1` suppresses optimized code generation for 'for-in-downTo' + // JVM IR: No getProgressionLastElement() call required for `step 1`, equivalent to `5 downTo 1` + for (i in 5 downTo 1 step 1) { } } +// JVM non-IR does NOT specifically handle "step" progressions. The stepped progressions in the above code are constructed and their +// first/last/step properties are retrieved. +// JVM IR has an optimized handler for "step" progressions and elides the construction of the stepped progressions. +// +// Expected lowered form of `for (i in 0..5 step 2)`: +// +// // Standard form of loop over progression +// var inductionVar = 0 +// val last = getProgressionLastElement(0, 5, 2) +// val step = 2 +// if (inductionVar <= last) { +// // Loop is not empty +// do { +// val i = inductionVar +// inductionVar += step +// // Loop body +// } while (i != last) +// } +// +// Expected lowered form of `for (i in 5 downTo 1 step 1)`: +// +// // Standard form of loop over progression +// var inductionVar = 5 +// val last = 1 +// val step = -1 +// if (last <= inductionVar) { // Optimized out in bytecode +// // Loop is not empty +// do { +// val i = inductionVar +// inductionVar += step +// // Loop body +// } while (last <= inductionVar) +// } + // 0 iterator + +// JVM_TEMPLATES // 2 getFirst // 2 getLast -// 2 getStep \ No newline at end of file +// 2 getStep + +// JVM_IR_TEMPLATES +// 0 getStart +// 0 getEnd +// 0 getFirst +// 0 getLast +// 0 getStep +// 1 IF_ICMPGT +// 1 IF_ICMPNE +// 1 IF_ICMPLE +// 3 IF +// 1 INVOKESTATIC kotlin/internal/ProgressionUtilKt.getProgressionLastElement \(III\)I \ No newline at end of file diff --git a/compiler/testData/codegen/bytecodeText/intProgressionNoBoxing.kt b/compiler/testData/codegen/bytecodeText/intProgressionNoBoxing.kt new file mode 100644 index 00000000000..8b9eb1f54a8 --- /dev/null +++ b/compiler/testData/codegen/bytecodeText/intProgressionNoBoxing.kt @@ -0,0 +1,20 @@ +fun foo() { + for (i in 1..2 step 4) {} +} + +// JVM non-IR does NOT specifically handle "step" progressions. The stepped progression in the above code are constructed and its +// first/last/step properties are retrieved. +// JVM IR has an optimized handler for "step" progressions and elides the construction of the stepped progressions. + +// JVM_TEMPLATES +// 1 INVOKEVIRTUAL kotlin/ranges/IntProgression.getFirst \(\)I +// 1 getFirst +// 1 INVOKEVIRTUAL kotlin/ranges/IntProgression.getLast \(\)I +// 1 getLast +// 1 INVOKEVIRTUAL kotlin/ranges/IntProgression.getStep \(\)I +// 1 getStep + +// JVM_IR_TEMPLATES +// 0 getFirst +// 0 getLast +// 0 getStep \ No newline at end of file diff --git a/compiler/testData/codegen/bytecodeText/intRangeNoBoxing.kt b/compiler/testData/codegen/bytecodeText/intRangeNoBoxing.kt index 766ede8b317..75bf5a5c96e 100644 --- a/compiler/testData/codegen/bytecodeText/intRangeNoBoxing.kt +++ b/compiler/testData/codegen/bytecodeText/intRangeNoBoxing.kt @@ -1,18 +1,10 @@ fun Int.until(other: Int) = this..other - 1 fun foo() { val range = 1 until 2 - for (i in range) { - } - - for (i in 1..2 step 4) {} + for (i in range) {} } // 1 INVOKEVIRTUAL kotlin/ranges/IntRange.getFirst \(\)I -// 0 INVOKEVIRTUAL kotlin/ranges/IntRange.getFirst \(\)Ljava/lang/Integer; +// 1 getFirst // 1 INVOKEVIRTUAL kotlin/ranges/IntRange.getLast \(\)I -// 0 INVOKEVIRTUAL kotlin/ranges/IntRange.getLast \(\)Ljava/lang/Integer; - -// 1 INVOKEVIRTUAL kotlin/ranges/IntProgression.getFirst \(\)I -// 0 INVOKEVIRTUAL kotlin/ranges/IntProgression.getFirst \(\)Ljava/lang/Integer; -// 1 INVOKEVIRTUAL kotlin/ranges/IntProgression.getLast \(\)I -// 0 INVOKEVIRTUAL kotlin/ranges/IntProgression.getLast \(\)Ljava/lang/Integer; \ No newline at end of file +// 1 getLast \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java index 2f68232f53d..1d4707b0e27 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java @@ -19393,6 +19393,178 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { public void testForInUntilReversedReversed() throws Exception { runTest("compiler/testData/codegen/box/ranges/evaluationOrder/forInUntilReversedReversed.kt"); } + + @TestMetadata("compiler/testData/codegen/box/ranges/evaluationOrder/stepped") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Stepped extends AbstractBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInStepped() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/evaluationOrder/stepped"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class ForInDownTo extends AbstractBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInForInDownTo() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("forInDownToReversedStep.kt") + public void testForInDownToReversedStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToReversedStep.kt"); + } + + @TestMetadata("forInDownToReversedStepReversed.kt") + public void testForInDownToReversedStepReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToReversedStepReversed.kt"); + } + + @TestMetadata("forInDownToReversedStepReversedStep.kt") + public void testForInDownToReversedStepReversedStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToReversedStepReversedStep.kt"); + } + + @TestMetadata("forInDownToStep.kt") + public void testForInDownToStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToStep.kt"); + } + + @TestMetadata("forInDownToStepReversed.kt") + public void testForInDownToStepReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToStepReversed.kt"); + } + + @TestMetadata("forInDownToStepReversedStep.kt") + public void testForInDownToStepReversedStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToStepReversedStep.kt"); + } + + @TestMetadata("forInDownToStepReversedStepReversed.kt") + public void testForInDownToStepReversedStepReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToStepReversedStepReversed.kt"); + } + + @TestMetadata("forInDownToStepStep.kt") + public void testForInDownToStepStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToStepStep.kt"); + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class ForInRangeLiteral extends AbstractBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInForInRangeLiteral() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("forInRangeLiteralReversedStep.kt") + public void testForInRangeLiteralReversedStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralReversedStep.kt"); + } + + @TestMetadata("forInRangeLiteralReversedStepReversed.kt") + public void testForInRangeLiteralReversedStepReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralReversedStepReversed.kt"); + } + + @TestMetadata("forInRangeLiteralReversedStepReversedStep.kt") + public void testForInRangeLiteralReversedStepReversedStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralReversedStepReversedStep.kt"); + } + + @TestMetadata("forInRangeLiteralStep.kt") + public void testForInRangeLiteralStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralStep.kt"); + } + + @TestMetadata("forInRangeLiteralStepReversed.kt") + public void testForInRangeLiteralStepReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralStepReversed.kt"); + } + + @TestMetadata("forInRangeLiteralStepReversedStep.kt") + public void testForInRangeLiteralStepReversedStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralStepReversedStep.kt"); + } + + @TestMetadata("forInRangeLiteralStepReversedStepReversed.kt") + public void testForInRangeLiteralStepReversedStepReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralStepReversedStepReversed.kt"); + } + + @TestMetadata("forInRangeLiteralStepStep.kt") + public void testForInRangeLiteralStepStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralStepStep.kt"); + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class ForInUntil extends AbstractBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInForInUntil() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("forInUntilReversedStep.kt") + public void testForInUntilReversedStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilReversedStep.kt"); + } + + @TestMetadata("forInUntilReversedStepReversed.kt") + public void testForInUntilReversedStepReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilReversedStepReversed.kt"); + } + + @TestMetadata("forInUntilReversedStepReversedStep.kt") + public void testForInUntilReversedStepReversedStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilReversedStepReversedStep.kt"); + } + + @TestMetadata("forInUntilStep.kt") + public void testForInUntilStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilStep.kt"); + } + + @TestMetadata("forInUntilStepReversed.kt") + public void testForInUntilStepReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilStepReversed.kt"); + } + + @TestMetadata("forInUntilStepReversedStep.kt") + public void testForInUntilStepReversedStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilStepReversedStep.kt"); + } + + @TestMetadata("forInUntilStepReversedStepReversed.kt") + public void testForInUntilStepReversedStepReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilStepReversedStepReversed.kt"); + } + + @TestMetadata("forInUntilStepStep.kt") + public void testForInUntilStepStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilStepStep.kt"); + } + } + } } @TestMetadata("compiler/testData/codegen/box/ranges/expression") @@ -20144,6 +20316,1184 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { } } + @TestMetadata("compiler/testData/codegen/box/ranges/stepped") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Stepped extends AbstractBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInStepped() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/expression") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Expression extends AbstractBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInExpression() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/expression"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/expression/downTo") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class DownTo extends AbstractBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInDownTo() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/expression/downTo"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("emptyProgression.kt") + public void testEmptyProgression() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/emptyProgression.kt"); + } + + @TestMetadata("illegalStepNegative.kt") + public void testIllegalStepNegative() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/illegalStepNegative.kt"); + } + + @TestMetadata("illegalStepNonConst.kt") + public void testIllegalStepNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/illegalStepNonConst.kt"); + } + + @TestMetadata("illegalStepThenLegalStep.kt") + public void testIllegalStepThenLegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/illegalStepThenLegalStep.kt"); + } + + @TestMetadata("illegalStepZero.kt") + public void testIllegalStepZero() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/illegalStepZero.kt"); + } + + @TestMetadata("legalStepThenIllegalStep.kt") + public void testLegalStepThenIllegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/legalStepThenIllegalStep.kt"); + } + + @TestMetadata("maxValueToMinValueStepMaxValue.kt") + public void testMaxValueToMinValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/maxValueToMinValueStepMaxValue.kt"); + } + + @TestMetadata("maxValueToOneStepMaxValue.kt") + public void testMaxValueToOneStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/maxValueToOneStepMaxValue.kt"); + } + + @TestMetadata("maxValueToZeroStepMaxValue.kt") + public void testMaxValueToZeroStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/maxValueToZeroStepMaxValue.kt"); + } + + @TestMetadata("mixedTypeStep.kt") + public void testMixedTypeStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/mixedTypeStep.kt"); + } + + @TestMetadata("singleElementStepTwo.kt") + public void testSingleElementStepTwo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/singleElementStepTwo.kt"); + } + + @TestMetadata("stepNonConst.kt") + public void testStepNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/stepNonConst.kt"); + } + + @TestMetadata("stepOne.kt") + public void testStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/stepOne.kt"); + } + + @TestMetadata("stepToOutsideRange.kt") + public void testStepToOutsideRange() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/stepToOutsideRange.kt"); + } + + @TestMetadata("stepToSameLast.kt") + public void testStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/stepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLast.kt") + public void testStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/stepToSmallerLast.kt"); + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class NestedStep extends AbstractBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInNestedStep() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("stepOneThenStepOne.kt") + public void testStepOneThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepOneThenStepOne.kt"); + } + + @TestMetadata("stepThenSameStep.kt") + public void testStepThenSameStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepThenSameStep.kt"); + } + + @TestMetadata("stepToSameLastThenStepOne.kt") + public void testStepToSameLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepToSameLastThenStepOne.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSameLast.kt") + public void testStepToSameLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepToSameLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSmallerLast.kt") + public void testStepToSameLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepToSameLastThenStepToSmallerLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepOne.kt") + public void testStepToSmallerLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepToSmallerLastThenStepOne.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSameLast.kt") + public void testStepToSmallerLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepToSmallerLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSmallerLast.kt") + public void testStepToSmallerLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepToSmallerLastThenStepToSmallerLast.kt"); + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/expression/downTo/reversed") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Reversed extends AbstractBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInReversed() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/expression/downTo/reversed"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("reversedThenStep.kt") + public void testReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/reversed/reversedThenStep.kt"); + } + + @TestMetadata("reversedThenStepThenReversed.kt") + public void testReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/reversed/reversedThenStepThenReversed.kt"); + } + + @TestMetadata("reversedThenStepThenReversedThenStep.kt") + public void testReversedThenStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/reversed/reversedThenStepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversed.kt") + public void testStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/reversed/stepThenReversed.kt"); + } + + @TestMetadata("stepThenReversedThenStep.kt") + public void testStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/reversed/stepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversedThenStepThenReversed.kt") + public void testStepThenReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/reversed/stepThenReversedThenStepThenReversed.kt"); + } + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class RangeTo extends AbstractBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInRangeTo() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("emptyProgression.kt") + public void testEmptyProgression() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/emptyProgression.kt"); + } + + @TestMetadata("illegalStepNegative.kt") + public void testIllegalStepNegative() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/illegalStepNegative.kt"); + } + + @TestMetadata("illegalStepNonConst.kt") + public void testIllegalStepNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/illegalStepNonConst.kt"); + } + + @TestMetadata("illegalStepThenLegalStep.kt") + public void testIllegalStepThenLegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/illegalStepThenLegalStep.kt"); + } + + @TestMetadata("illegalStepZero.kt") + public void testIllegalStepZero() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/illegalStepZero.kt"); + } + + @TestMetadata("legalStepThenIllegalStep.kt") + public void testLegalStepThenIllegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/legalStepThenIllegalStep.kt"); + } + + @TestMetadata("minValueToMaxValueStepMaxValue.kt") + public void testMinValueToMaxValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/minValueToMaxValueStepMaxValue.kt"); + } + + @TestMetadata("mixedTypeStep.kt") + public void testMixedTypeStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/mixedTypeStep.kt"); + } + + @TestMetadata("oneToMaxValueStepMaxValue.kt") + public void testOneToMaxValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/oneToMaxValueStepMaxValue.kt"); + } + + @TestMetadata("singleElementStepTwo.kt") + public void testSingleElementStepTwo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/singleElementStepTwo.kt"); + } + + @TestMetadata("stepNonConst.kt") + public void testStepNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/stepNonConst.kt"); + } + + @TestMetadata("stepOne.kt") + public void testStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/stepOne.kt"); + } + + @TestMetadata("stepToOutsideRange.kt") + public void testStepToOutsideRange() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/stepToOutsideRange.kt"); + } + + @TestMetadata("stepToSameLast.kt") + public void testStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/stepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLast.kt") + public void testStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/stepToSmallerLast.kt"); + } + + @TestMetadata("zeroToMaxValueStepMaxValue.kt") + public void testZeroToMaxValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/zeroToMaxValueStepMaxValue.kt"); + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class NestedStep extends AbstractBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInNestedStep() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("stepOneThenStepOne.kt") + public void testStepOneThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepOneThenStepOne.kt"); + } + + @TestMetadata("stepThenSameStep.kt") + public void testStepThenSameStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepThenSameStep.kt"); + } + + @TestMetadata("stepToSameLastThenStepOne.kt") + public void testStepToSameLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepToSameLastThenStepOne.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSameLast.kt") + public void testStepToSameLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepToSameLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSmallerLast.kt") + public void testStepToSameLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepToSameLastThenStepToSmallerLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepOne.kt") + public void testStepToSmallerLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepToSmallerLastThenStepOne.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSameLast.kt") + public void testStepToSmallerLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepToSmallerLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSmallerLast.kt") + public void testStepToSmallerLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepToSmallerLastThenStepToSmallerLast.kt"); + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/reversed") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Reversed extends AbstractBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInReversed() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/reversed"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("reversedThenStep.kt") + public void testReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/reversed/reversedThenStep.kt"); + } + + @TestMetadata("reversedThenStepThenReversed.kt") + public void testReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/reversed/reversedThenStepThenReversed.kt"); + } + + @TestMetadata("reversedThenStepThenReversedThenStep.kt") + public void testReversedThenStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/reversed/reversedThenStepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversed.kt") + public void testStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/reversed/stepThenReversed.kt"); + } + + @TestMetadata("stepThenReversedThenStep.kt") + public void testStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/reversed/stepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversedThenStepThenReversed.kt") + public void testStepThenReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/reversed/stepThenReversedThenStepThenReversed.kt"); + } + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/expression/until") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Until extends AbstractBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInUntil() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/expression/until"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("emptyProgression.kt") + public void testEmptyProgression() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/emptyProgression.kt"); + } + + @TestMetadata("emptyProgressionToMinValue.kt") + public void testEmptyProgressionToMinValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/emptyProgressionToMinValue.kt"); + } + + @TestMetadata("illegalStepNegative.kt") + public void testIllegalStepNegative() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/illegalStepNegative.kt"); + } + + @TestMetadata("illegalStepNonConst.kt") + public void testIllegalStepNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/illegalStepNonConst.kt"); + } + + @TestMetadata("illegalStepThenLegalStep.kt") + public void testIllegalStepThenLegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/illegalStepThenLegalStep.kt"); + } + + @TestMetadata("illegalStepZero.kt") + public void testIllegalStepZero() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/illegalStepZero.kt"); + } + + @TestMetadata("legalStepThenIllegalStep.kt") + public void testLegalStepThenIllegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/legalStepThenIllegalStep.kt"); + } + + @TestMetadata("minValueToMaxValueStepMaxValue.kt") + public void testMinValueToMaxValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/minValueToMaxValueStepMaxValue.kt"); + } + + @TestMetadata("mixedTypeStep.kt") + public void testMixedTypeStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/mixedTypeStep.kt"); + } + + @TestMetadata("singleElementStepTwo.kt") + public void testSingleElementStepTwo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/singleElementStepTwo.kt"); + } + + @TestMetadata("stepNonConst.kt") + public void testStepNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/stepNonConst.kt"); + } + + @TestMetadata("stepOne.kt") + public void testStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/stepOne.kt"); + } + + @TestMetadata("stepToOutsideRange.kt") + public void testStepToOutsideRange() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/stepToOutsideRange.kt"); + } + + @TestMetadata("stepToSameLast.kt") + public void testStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/stepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLast.kt") + public void testStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/stepToSmallerLast.kt"); + } + + @TestMetadata("zeroToMaxValueStepMaxValue.kt") + public void testZeroToMaxValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/zeroToMaxValueStepMaxValue.kt"); + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class NestedStep extends AbstractBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInNestedStep() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("stepOneThenStepOne.kt") + public void testStepOneThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepOneThenStepOne.kt"); + } + + @TestMetadata("stepThenSameStep.kt") + public void testStepThenSameStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepThenSameStep.kt"); + } + + @TestMetadata("stepToSameLastThenStepOne.kt") + public void testStepToSameLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepToSameLastThenStepOne.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSameLast.kt") + public void testStepToSameLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepToSameLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSmallerLast.kt") + public void testStepToSameLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepToSameLastThenStepToSmallerLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepOne.kt") + public void testStepToSmallerLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepToSmallerLastThenStepOne.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSameLast.kt") + public void testStepToSmallerLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepToSmallerLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSmallerLast.kt") + public void testStepToSmallerLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepToSmallerLastThenStepToSmallerLast.kt"); + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/expression/until/reversed") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Reversed extends AbstractBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInReversed() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/expression/until/reversed"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("reversedThenStep.kt") + public void testReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/reversed/reversedThenStep.kt"); + } + + @TestMetadata("reversedThenStepThenReversed.kt") + public void testReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/reversed/reversedThenStepThenReversed.kt"); + } + + @TestMetadata("reversedThenStepThenReversedThenStep.kt") + public void testReversedThenStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/reversed/reversedThenStepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversed.kt") + public void testStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/reversed/stepThenReversed.kt"); + } + + @TestMetadata("stepThenReversedThenStep.kt") + public void testStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/reversed/stepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversedThenStepThenReversed.kt") + public void testStepThenReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/reversed/stepThenReversedThenStepThenReversed.kt"); + } + } + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/literal") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Literal extends AbstractBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInLiteral() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/literal"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/literal/downTo") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class DownTo extends AbstractBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInDownTo() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/literal/downTo"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("emptyProgression.kt") + public void testEmptyProgression() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/emptyProgression.kt"); + } + + @TestMetadata("illegalStepNegative.kt") + public void testIllegalStepNegative() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/illegalStepNegative.kt"); + } + + @TestMetadata("illegalStepNonConst.kt") + public void testIllegalStepNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/illegalStepNonConst.kt"); + } + + @TestMetadata("illegalStepThenLegalStep.kt") + public void testIllegalStepThenLegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/illegalStepThenLegalStep.kt"); + } + + @TestMetadata("illegalStepZero.kt") + public void testIllegalStepZero() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/illegalStepZero.kt"); + } + + @TestMetadata("legalStepThenIllegalStep.kt") + public void testLegalStepThenIllegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/legalStepThenIllegalStep.kt"); + } + + @TestMetadata("maxValueToMinValueStepMaxValue.kt") + public void testMaxValueToMinValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/maxValueToMinValueStepMaxValue.kt"); + } + + @TestMetadata("maxValueToOneStepMaxValue.kt") + public void testMaxValueToOneStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/maxValueToOneStepMaxValue.kt"); + } + + @TestMetadata("maxValueToZeroStepMaxValue.kt") + public void testMaxValueToZeroStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/maxValueToZeroStepMaxValue.kt"); + } + + @TestMetadata("mixedTypeStep.kt") + public void testMixedTypeStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/mixedTypeStep.kt"); + } + + @TestMetadata("singleElementStepTwo.kt") + public void testSingleElementStepTwo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/singleElementStepTwo.kt"); + } + + @TestMetadata("stepNonConst.kt") + public void testStepNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/stepNonConst.kt"); + } + + @TestMetadata("stepOne.kt") + public void testStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/stepOne.kt"); + } + + @TestMetadata("stepToOutsideRange.kt") + public void testStepToOutsideRange() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/stepToOutsideRange.kt"); + } + + @TestMetadata("stepToSameLast.kt") + public void testStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/stepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLast.kt") + public void testStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/stepToSmallerLast.kt"); + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class NestedStep extends AbstractBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInNestedStep() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("stepOneThenStepOne.kt") + public void testStepOneThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepOneThenStepOne.kt"); + } + + @TestMetadata("stepThenSameStep.kt") + public void testStepThenSameStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepThenSameStep.kt"); + } + + @TestMetadata("stepToSameLastThenStepOne.kt") + public void testStepToSameLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepToSameLastThenStepOne.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSameLast.kt") + public void testStepToSameLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepToSameLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSmallerLast.kt") + public void testStepToSameLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepToSameLastThenStepToSmallerLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepOne.kt") + public void testStepToSmallerLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepToSmallerLastThenStepOne.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSameLast.kt") + public void testStepToSmallerLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepToSmallerLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSmallerLast.kt") + public void testStepToSmallerLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepToSmallerLastThenStepToSmallerLast.kt"); + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/literal/downTo/reversed") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Reversed extends AbstractBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInReversed() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/literal/downTo/reversed"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("reversedThenStep.kt") + public void testReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/reversed/reversedThenStep.kt"); + } + + @TestMetadata("reversedThenStepThenReversed.kt") + public void testReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/reversed/reversedThenStepThenReversed.kt"); + } + + @TestMetadata("reversedThenStepThenReversedThenStep.kt") + public void testReversedThenStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/reversed/reversedThenStepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversed.kt") + public void testStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/reversed/stepThenReversed.kt"); + } + + @TestMetadata("stepThenReversedThenStep.kt") + public void testStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/reversed/stepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversedThenStepThenReversed.kt") + public void testStepThenReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/reversed/stepThenReversedThenStepThenReversed.kt"); + } + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class RangeTo extends AbstractBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInRangeTo() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("emptyProgression.kt") + public void testEmptyProgression() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/emptyProgression.kt"); + } + + @TestMetadata("illegalStepNegative.kt") + public void testIllegalStepNegative() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/illegalStepNegative.kt"); + } + + @TestMetadata("illegalStepNonConst.kt") + public void testIllegalStepNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/illegalStepNonConst.kt"); + } + + @TestMetadata("illegalStepThenLegalStep.kt") + public void testIllegalStepThenLegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/illegalStepThenLegalStep.kt"); + } + + @TestMetadata("illegalStepZero.kt") + public void testIllegalStepZero() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/illegalStepZero.kt"); + } + + @TestMetadata("legalStepThenIllegalStep.kt") + public void testLegalStepThenIllegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/legalStepThenIllegalStep.kt"); + } + + @TestMetadata("minValueToMaxValueStepMaxValue.kt") + public void testMinValueToMaxValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/minValueToMaxValueStepMaxValue.kt"); + } + + @TestMetadata("mixedTypeStep.kt") + public void testMixedTypeStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/mixedTypeStep.kt"); + } + + @TestMetadata("oneToMaxValueStepMaxValue.kt") + public void testOneToMaxValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/oneToMaxValueStepMaxValue.kt"); + } + + @TestMetadata("singleElementStepTwo.kt") + public void testSingleElementStepTwo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/singleElementStepTwo.kt"); + } + + @TestMetadata("stepNonConst.kt") + public void testStepNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/stepNonConst.kt"); + } + + @TestMetadata("stepOne.kt") + public void testStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/stepOne.kt"); + } + + @TestMetadata("stepToOutsideRange.kt") + public void testStepToOutsideRange() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/stepToOutsideRange.kt"); + } + + @TestMetadata("stepToSameLast.kt") + public void testStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/stepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLast.kt") + public void testStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/stepToSmallerLast.kt"); + } + + @TestMetadata("zeroToMaxValueStepMaxValue.kt") + public void testZeroToMaxValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/zeroToMaxValueStepMaxValue.kt"); + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class NestedStep extends AbstractBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInNestedStep() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("stepOneThenStepOne.kt") + public void testStepOneThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepOneThenStepOne.kt"); + } + + @TestMetadata("stepThenSameStep.kt") + public void testStepThenSameStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepThenSameStep.kt"); + } + + @TestMetadata("stepToSameLastThenStepOne.kt") + public void testStepToSameLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepToSameLastThenStepOne.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSameLast.kt") + public void testStepToSameLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepToSameLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSmallerLast.kt") + public void testStepToSameLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepToSameLastThenStepToSmallerLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepOne.kt") + public void testStepToSmallerLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepToSmallerLastThenStepOne.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSameLast.kt") + public void testStepToSmallerLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepToSmallerLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSmallerLast.kt") + public void testStepToSmallerLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepToSmallerLastThenStepToSmallerLast.kt"); + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/reversed") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Reversed extends AbstractBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInReversed() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/reversed"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("reversedThenStep.kt") + public void testReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/reversed/reversedThenStep.kt"); + } + + @TestMetadata("reversedThenStepThenReversed.kt") + public void testReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/reversed/reversedThenStepThenReversed.kt"); + } + + @TestMetadata("reversedThenStepThenReversedThenStep.kt") + public void testReversedThenStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/reversed/reversedThenStepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversed.kt") + public void testStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/reversed/stepThenReversed.kt"); + } + + @TestMetadata("stepThenReversedThenStep.kt") + public void testStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/reversed/stepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversedThenStepThenReversed.kt") + public void testStepThenReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/reversed/stepThenReversedThenStepThenReversed.kt"); + } + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/literal/until") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Until extends AbstractBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInUntil() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/literal/until"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("emptyProgression.kt") + public void testEmptyProgression() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/emptyProgression.kt"); + } + + @TestMetadata("emptyProgressionToMinValue.kt") + public void testEmptyProgressionToMinValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/emptyProgressionToMinValue.kt"); + } + + @TestMetadata("illegalStepNegative.kt") + public void testIllegalStepNegative() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/illegalStepNegative.kt"); + } + + @TestMetadata("illegalStepNonConst.kt") + public void testIllegalStepNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/illegalStepNonConst.kt"); + } + + @TestMetadata("illegalStepThenLegalStep.kt") + public void testIllegalStepThenLegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/illegalStepThenLegalStep.kt"); + } + + @TestMetadata("illegalStepZero.kt") + public void testIllegalStepZero() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/illegalStepZero.kt"); + } + + @TestMetadata("legalStepThenIllegalStep.kt") + public void testLegalStepThenIllegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/legalStepThenIllegalStep.kt"); + } + + @TestMetadata("minValueToMaxValueStepMaxValue.kt") + public void testMinValueToMaxValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/minValueToMaxValueStepMaxValue.kt"); + } + + @TestMetadata("mixedTypeStep.kt") + public void testMixedTypeStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/mixedTypeStep.kt"); + } + + @TestMetadata("progressionToNonConst.kt") + public void testProgressionToNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/progressionToNonConst.kt"); + } + + @TestMetadata("singleElementStepTwo.kt") + public void testSingleElementStepTwo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/singleElementStepTwo.kt"); + } + + @TestMetadata("stepNonConst.kt") + public void testStepNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/stepNonConst.kt"); + } + + @TestMetadata("stepOne.kt") + public void testStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/stepOne.kt"); + } + + @TestMetadata("stepToOutsideRange.kt") + public void testStepToOutsideRange() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/stepToOutsideRange.kt"); + } + + @TestMetadata("stepToSameLast.kt") + public void testStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/stepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLast.kt") + public void testStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/stepToSmallerLast.kt"); + } + + @TestMetadata("zeroToMaxValueStepMaxValue.kt") + public void testZeroToMaxValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/zeroToMaxValueStepMaxValue.kt"); + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class NestedStep extends AbstractBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInNestedStep() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("stepOneThenStepOne.kt") + public void testStepOneThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepOneThenStepOne.kt"); + } + + @TestMetadata("stepThenSameStep.kt") + public void testStepThenSameStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepThenSameStep.kt"); + } + + @TestMetadata("stepToSameLastThenStepOne.kt") + public void testStepToSameLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepToSameLastThenStepOne.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSameLast.kt") + public void testStepToSameLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepToSameLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSmallerLast.kt") + public void testStepToSameLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepToSameLastThenStepToSmallerLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepOne.kt") + public void testStepToSmallerLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepToSmallerLastThenStepOne.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSameLast.kt") + public void testStepToSmallerLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepToSmallerLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSmallerLast.kt") + public void testStepToSmallerLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepToSmallerLastThenStepToSmallerLast.kt"); + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/literal/until/reversed") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Reversed extends AbstractBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInReversed() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/literal/until/reversed"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("reversedThenStep.kt") + public void testReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/reversed/reversedThenStep.kt"); + } + + @TestMetadata("reversedThenStepThenReversed.kt") + public void testReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/reversed/reversedThenStepThenReversed.kt"); + } + + @TestMetadata("reversedThenStepThenReversedThenStep.kt") + public void testReversedThenStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/reversed/reversedThenStepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversed.kt") + public void testStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/reversed/stepThenReversed.kt"); + } + + @TestMetadata("stepThenReversedThenStep.kt") + public void testStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/reversed/stepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversedThenStepThenReversed.kt") + public void testStepThenReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/reversed/stepThenReversedThenStepThenReversed.kt"); + } + } + } + } + } + @TestMetadata("compiler/testData/codegen/box/ranges/unsigned") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeTextTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeTextTestGenerated.java index e812bd57b65..e07d238bdfc 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeTextTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeTextTestGenerated.java @@ -159,6 +159,11 @@ public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest { runTest("compiler/testData/codegen/bytecodeText/intConstantSafeCall.kt"); } + @TestMetadata("intProgressionNoBoxing.kt") + public void testIntProgressionNoBoxing() throws Exception { + runTest("compiler/testData/codegen/bytecodeText/intProgressionNoBoxing.kt"); + } + @TestMetadata("intRangeNoBoxing.kt") public void testIntRangeNoBoxing() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intRangeNoBoxing.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index e24fcb2d84a..6383cbcd3ef 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -19393,6 +19393,178 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes public void testForInUntilReversedReversed() throws Exception { runTest("compiler/testData/codegen/box/ranges/evaluationOrder/forInUntilReversedReversed.kt"); } + + @TestMetadata("compiler/testData/codegen/box/ranges/evaluationOrder/stepped") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Stepped extends AbstractLightAnalysisModeTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInStepped() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/evaluationOrder/stepped"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class ForInDownTo extends AbstractLightAnalysisModeTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInForInDownTo() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("forInDownToReversedStep.kt") + public void testForInDownToReversedStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToReversedStep.kt"); + } + + @TestMetadata("forInDownToReversedStepReversed.kt") + public void testForInDownToReversedStepReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToReversedStepReversed.kt"); + } + + @TestMetadata("forInDownToReversedStepReversedStep.kt") + public void testForInDownToReversedStepReversedStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToReversedStepReversedStep.kt"); + } + + @TestMetadata("forInDownToStep.kt") + public void testForInDownToStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToStep.kt"); + } + + @TestMetadata("forInDownToStepReversed.kt") + public void testForInDownToStepReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToStepReversed.kt"); + } + + @TestMetadata("forInDownToStepReversedStep.kt") + public void testForInDownToStepReversedStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToStepReversedStep.kt"); + } + + @TestMetadata("forInDownToStepReversedStepReversed.kt") + public void testForInDownToStepReversedStepReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToStepReversedStepReversed.kt"); + } + + @TestMetadata("forInDownToStepStep.kt") + public void testForInDownToStepStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToStepStep.kt"); + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class ForInRangeLiteral extends AbstractLightAnalysisModeTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInForInRangeLiteral() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("forInRangeLiteralReversedStep.kt") + public void testForInRangeLiteralReversedStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralReversedStep.kt"); + } + + @TestMetadata("forInRangeLiteralReversedStepReversed.kt") + public void testForInRangeLiteralReversedStepReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralReversedStepReversed.kt"); + } + + @TestMetadata("forInRangeLiteralReversedStepReversedStep.kt") + public void testForInRangeLiteralReversedStepReversedStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralReversedStepReversedStep.kt"); + } + + @TestMetadata("forInRangeLiteralStep.kt") + public void testForInRangeLiteralStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralStep.kt"); + } + + @TestMetadata("forInRangeLiteralStepReversed.kt") + public void testForInRangeLiteralStepReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralStepReversed.kt"); + } + + @TestMetadata("forInRangeLiteralStepReversedStep.kt") + public void testForInRangeLiteralStepReversedStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralStepReversedStep.kt"); + } + + @TestMetadata("forInRangeLiteralStepReversedStepReversed.kt") + public void testForInRangeLiteralStepReversedStepReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralStepReversedStepReversed.kt"); + } + + @TestMetadata("forInRangeLiteralStepStep.kt") + public void testForInRangeLiteralStepStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralStepStep.kt"); + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class ForInUntil extends AbstractLightAnalysisModeTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInForInUntil() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("forInUntilReversedStep.kt") + public void testForInUntilReversedStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilReversedStep.kt"); + } + + @TestMetadata("forInUntilReversedStepReversed.kt") + public void testForInUntilReversedStepReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilReversedStepReversed.kt"); + } + + @TestMetadata("forInUntilReversedStepReversedStep.kt") + public void testForInUntilReversedStepReversedStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilReversedStepReversedStep.kt"); + } + + @TestMetadata("forInUntilStep.kt") + public void testForInUntilStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilStep.kt"); + } + + @TestMetadata("forInUntilStepReversed.kt") + public void testForInUntilStepReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilStepReversed.kt"); + } + + @TestMetadata("forInUntilStepReversedStep.kt") + public void testForInUntilStepReversedStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilStepReversedStep.kt"); + } + + @TestMetadata("forInUntilStepReversedStepReversed.kt") + public void testForInUntilStepReversedStepReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilStepReversedStepReversed.kt"); + } + + @TestMetadata("forInUntilStepStep.kt") + public void testForInUntilStepStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilStepStep.kt"); + } + } + } } @TestMetadata("compiler/testData/codegen/box/ranges/expression") @@ -20144,6 +20316,1184 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes } } + @TestMetadata("compiler/testData/codegen/box/ranges/stepped") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Stepped extends AbstractLightAnalysisModeTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInStepped() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/expression") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Expression extends AbstractLightAnalysisModeTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInExpression() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/expression"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/expression/downTo") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class DownTo extends AbstractLightAnalysisModeTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInDownTo() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/expression/downTo"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("emptyProgression.kt") + public void testEmptyProgression() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/emptyProgression.kt"); + } + + @TestMetadata("illegalStepNegative.kt") + public void testIllegalStepNegative() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/illegalStepNegative.kt"); + } + + @TestMetadata("illegalStepNonConst.kt") + public void testIllegalStepNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/illegalStepNonConst.kt"); + } + + @TestMetadata("illegalStepThenLegalStep.kt") + public void testIllegalStepThenLegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/illegalStepThenLegalStep.kt"); + } + + @TestMetadata("illegalStepZero.kt") + public void testIllegalStepZero() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/illegalStepZero.kt"); + } + + @TestMetadata("legalStepThenIllegalStep.kt") + public void testLegalStepThenIllegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/legalStepThenIllegalStep.kt"); + } + + @TestMetadata("maxValueToMinValueStepMaxValue.kt") + public void testMaxValueToMinValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/maxValueToMinValueStepMaxValue.kt"); + } + + @TestMetadata("maxValueToOneStepMaxValue.kt") + public void testMaxValueToOneStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/maxValueToOneStepMaxValue.kt"); + } + + @TestMetadata("maxValueToZeroStepMaxValue.kt") + public void testMaxValueToZeroStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/maxValueToZeroStepMaxValue.kt"); + } + + @TestMetadata("mixedTypeStep.kt") + public void testMixedTypeStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/mixedTypeStep.kt"); + } + + @TestMetadata("singleElementStepTwo.kt") + public void testSingleElementStepTwo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/singleElementStepTwo.kt"); + } + + @TestMetadata("stepNonConst.kt") + public void testStepNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/stepNonConst.kt"); + } + + @TestMetadata("stepOne.kt") + public void testStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/stepOne.kt"); + } + + @TestMetadata("stepToOutsideRange.kt") + public void testStepToOutsideRange() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/stepToOutsideRange.kt"); + } + + @TestMetadata("stepToSameLast.kt") + public void testStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/stepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLast.kt") + public void testStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/stepToSmallerLast.kt"); + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class NestedStep extends AbstractLightAnalysisModeTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInNestedStep() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("stepOneThenStepOne.kt") + public void testStepOneThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepOneThenStepOne.kt"); + } + + @TestMetadata("stepThenSameStep.kt") + public void testStepThenSameStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepThenSameStep.kt"); + } + + @TestMetadata("stepToSameLastThenStepOne.kt") + public void testStepToSameLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepToSameLastThenStepOne.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSameLast.kt") + public void testStepToSameLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepToSameLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSmallerLast.kt") + public void testStepToSameLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepToSameLastThenStepToSmallerLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepOne.kt") + public void testStepToSmallerLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepToSmallerLastThenStepOne.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSameLast.kt") + public void testStepToSmallerLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepToSmallerLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSmallerLast.kt") + public void testStepToSmallerLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepToSmallerLastThenStepToSmallerLast.kt"); + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/expression/downTo/reversed") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Reversed extends AbstractLightAnalysisModeTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInReversed() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/expression/downTo/reversed"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("reversedThenStep.kt") + public void testReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/reversed/reversedThenStep.kt"); + } + + @TestMetadata("reversedThenStepThenReversed.kt") + public void testReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/reversed/reversedThenStepThenReversed.kt"); + } + + @TestMetadata("reversedThenStepThenReversedThenStep.kt") + public void testReversedThenStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/reversed/reversedThenStepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversed.kt") + public void testStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/reversed/stepThenReversed.kt"); + } + + @TestMetadata("stepThenReversedThenStep.kt") + public void testStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/reversed/stepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversedThenStepThenReversed.kt") + public void testStepThenReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/reversed/stepThenReversedThenStepThenReversed.kt"); + } + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class RangeTo extends AbstractLightAnalysisModeTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInRangeTo() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("emptyProgression.kt") + public void testEmptyProgression() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/emptyProgression.kt"); + } + + @TestMetadata("illegalStepNegative.kt") + public void testIllegalStepNegative() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/illegalStepNegative.kt"); + } + + @TestMetadata("illegalStepNonConst.kt") + public void testIllegalStepNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/illegalStepNonConst.kt"); + } + + @TestMetadata("illegalStepThenLegalStep.kt") + public void testIllegalStepThenLegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/illegalStepThenLegalStep.kt"); + } + + @TestMetadata("illegalStepZero.kt") + public void testIllegalStepZero() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/illegalStepZero.kt"); + } + + @TestMetadata("legalStepThenIllegalStep.kt") + public void testLegalStepThenIllegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/legalStepThenIllegalStep.kt"); + } + + @TestMetadata("minValueToMaxValueStepMaxValue.kt") + public void testMinValueToMaxValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/minValueToMaxValueStepMaxValue.kt"); + } + + @TestMetadata("mixedTypeStep.kt") + public void testMixedTypeStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/mixedTypeStep.kt"); + } + + @TestMetadata("oneToMaxValueStepMaxValue.kt") + public void testOneToMaxValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/oneToMaxValueStepMaxValue.kt"); + } + + @TestMetadata("singleElementStepTwo.kt") + public void testSingleElementStepTwo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/singleElementStepTwo.kt"); + } + + @TestMetadata("stepNonConst.kt") + public void testStepNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/stepNonConst.kt"); + } + + @TestMetadata("stepOne.kt") + public void testStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/stepOne.kt"); + } + + @TestMetadata("stepToOutsideRange.kt") + public void testStepToOutsideRange() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/stepToOutsideRange.kt"); + } + + @TestMetadata("stepToSameLast.kt") + public void testStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/stepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLast.kt") + public void testStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/stepToSmallerLast.kt"); + } + + @TestMetadata("zeroToMaxValueStepMaxValue.kt") + public void testZeroToMaxValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/zeroToMaxValueStepMaxValue.kt"); + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class NestedStep extends AbstractLightAnalysisModeTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInNestedStep() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("stepOneThenStepOne.kt") + public void testStepOneThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepOneThenStepOne.kt"); + } + + @TestMetadata("stepThenSameStep.kt") + public void testStepThenSameStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepThenSameStep.kt"); + } + + @TestMetadata("stepToSameLastThenStepOne.kt") + public void testStepToSameLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepToSameLastThenStepOne.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSameLast.kt") + public void testStepToSameLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepToSameLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSmallerLast.kt") + public void testStepToSameLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepToSameLastThenStepToSmallerLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepOne.kt") + public void testStepToSmallerLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepToSmallerLastThenStepOne.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSameLast.kt") + public void testStepToSmallerLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepToSmallerLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSmallerLast.kt") + public void testStepToSmallerLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepToSmallerLastThenStepToSmallerLast.kt"); + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/reversed") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Reversed extends AbstractLightAnalysisModeTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInReversed() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/reversed"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("reversedThenStep.kt") + public void testReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/reversed/reversedThenStep.kt"); + } + + @TestMetadata("reversedThenStepThenReversed.kt") + public void testReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/reversed/reversedThenStepThenReversed.kt"); + } + + @TestMetadata("reversedThenStepThenReversedThenStep.kt") + public void testReversedThenStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/reversed/reversedThenStepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversed.kt") + public void testStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/reversed/stepThenReversed.kt"); + } + + @TestMetadata("stepThenReversedThenStep.kt") + public void testStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/reversed/stepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversedThenStepThenReversed.kt") + public void testStepThenReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/reversed/stepThenReversedThenStepThenReversed.kt"); + } + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/expression/until") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Until extends AbstractLightAnalysisModeTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInUntil() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/expression/until"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("emptyProgression.kt") + public void testEmptyProgression() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/emptyProgression.kt"); + } + + @TestMetadata("emptyProgressionToMinValue.kt") + public void testEmptyProgressionToMinValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/emptyProgressionToMinValue.kt"); + } + + @TestMetadata("illegalStepNegative.kt") + public void testIllegalStepNegative() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/illegalStepNegative.kt"); + } + + @TestMetadata("illegalStepNonConst.kt") + public void testIllegalStepNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/illegalStepNonConst.kt"); + } + + @TestMetadata("illegalStepThenLegalStep.kt") + public void testIllegalStepThenLegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/illegalStepThenLegalStep.kt"); + } + + @TestMetadata("illegalStepZero.kt") + public void testIllegalStepZero() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/illegalStepZero.kt"); + } + + @TestMetadata("legalStepThenIllegalStep.kt") + public void testLegalStepThenIllegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/legalStepThenIllegalStep.kt"); + } + + @TestMetadata("minValueToMaxValueStepMaxValue.kt") + public void testMinValueToMaxValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/minValueToMaxValueStepMaxValue.kt"); + } + + @TestMetadata("mixedTypeStep.kt") + public void testMixedTypeStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/mixedTypeStep.kt"); + } + + @TestMetadata("singleElementStepTwo.kt") + public void testSingleElementStepTwo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/singleElementStepTwo.kt"); + } + + @TestMetadata("stepNonConst.kt") + public void testStepNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/stepNonConst.kt"); + } + + @TestMetadata("stepOne.kt") + public void testStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/stepOne.kt"); + } + + @TestMetadata("stepToOutsideRange.kt") + public void testStepToOutsideRange() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/stepToOutsideRange.kt"); + } + + @TestMetadata("stepToSameLast.kt") + public void testStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/stepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLast.kt") + public void testStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/stepToSmallerLast.kt"); + } + + @TestMetadata("zeroToMaxValueStepMaxValue.kt") + public void testZeroToMaxValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/zeroToMaxValueStepMaxValue.kt"); + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class NestedStep extends AbstractLightAnalysisModeTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInNestedStep() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("stepOneThenStepOne.kt") + public void testStepOneThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepOneThenStepOne.kt"); + } + + @TestMetadata("stepThenSameStep.kt") + public void testStepThenSameStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepThenSameStep.kt"); + } + + @TestMetadata("stepToSameLastThenStepOne.kt") + public void testStepToSameLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepToSameLastThenStepOne.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSameLast.kt") + public void testStepToSameLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepToSameLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSmallerLast.kt") + public void testStepToSameLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepToSameLastThenStepToSmallerLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepOne.kt") + public void testStepToSmallerLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepToSmallerLastThenStepOne.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSameLast.kt") + public void testStepToSmallerLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepToSmallerLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSmallerLast.kt") + public void testStepToSmallerLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepToSmallerLastThenStepToSmallerLast.kt"); + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/expression/until/reversed") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Reversed extends AbstractLightAnalysisModeTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInReversed() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/expression/until/reversed"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("reversedThenStep.kt") + public void testReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/reversed/reversedThenStep.kt"); + } + + @TestMetadata("reversedThenStepThenReversed.kt") + public void testReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/reversed/reversedThenStepThenReversed.kt"); + } + + @TestMetadata("reversedThenStepThenReversedThenStep.kt") + public void testReversedThenStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/reversed/reversedThenStepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversed.kt") + public void testStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/reversed/stepThenReversed.kt"); + } + + @TestMetadata("stepThenReversedThenStep.kt") + public void testStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/reversed/stepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversedThenStepThenReversed.kt") + public void testStepThenReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/reversed/stepThenReversedThenStepThenReversed.kt"); + } + } + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/literal") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Literal extends AbstractLightAnalysisModeTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInLiteral() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/literal"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/literal/downTo") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class DownTo extends AbstractLightAnalysisModeTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInDownTo() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/literal/downTo"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("emptyProgression.kt") + public void testEmptyProgression() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/emptyProgression.kt"); + } + + @TestMetadata("illegalStepNegative.kt") + public void testIllegalStepNegative() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/illegalStepNegative.kt"); + } + + @TestMetadata("illegalStepNonConst.kt") + public void testIllegalStepNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/illegalStepNonConst.kt"); + } + + @TestMetadata("illegalStepThenLegalStep.kt") + public void testIllegalStepThenLegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/illegalStepThenLegalStep.kt"); + } + + @TestMetadata("illegalStepZero.kt") + public void testIllegalStepZero() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/illegalStepZero.kt"); + } + + @TestMetadata("legalStepThenIllegalStep.kt") + public void testLegalStepThenIllegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/legalStepThenIllegalStep.kt"); + } + + @TestMetadata("maxValueToMinValueStepMaxValue.kt") + public void testMaxValueToMinValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/maxValueToMinValueStepMaxValue.kt"); + } + + @TestMetadata("maxValueToOneStepMaxValue.kt") + public void testMaxValueToOneStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/maxValueToOneStepMaxValue.kt"); + } + + @TestMetadata("maxValueToZeroStepMaxValue.kt") + public void testMaxValueToZeroStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/maxValueToZeroStepMaxValue.kt"); + } + + @TestMetadata("mixedTypeStep.kt") + public void testMixedTypeStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/mixedTypeStep.kt"); + } + + @TestMetadata("singleElementStepTwo.kt") + public void testSingleElementStepTwo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/singleElementStepTwo.kt"); + } + + @TestMetadata("stepNonConst.kt") + public void testStepNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/stepNonConst.kt"); + } + + @TestMetadata("stepOne.kt") + public void testStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/stepOne.kt"); + } + + @TestMetadata("stepToOutsideRange.kt") + public void testStepToOutsideRange() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/stepToOutsideRange.kt"); + } + + @TestMetadata("stepToSameLast.kt") + public void testStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/stepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLast.kt") + public void testStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/stepToSmallerLast.kt"); + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class NestedStep extends AbstractLightAnalysisModeTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInNestedStep() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("stepOneThenStepOne.kt") + public void testStepOneThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepOneThenStepOne.kt"); + } + + @TestMetadata("stepThenSameStep.kt") + public void testStepThenSameStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepThenSameStep.kt"); + } + + @TestMetadata("stepToSameLastThenStepOne.kt") + public void testStepToSameLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepToSameLastThenStepOne.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSameLast.kt") + public void testStepToSameLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepToSameLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSmallerLast.kt") + public void testStepToSameLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepToSameLastThenStepToSmallerLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepOne.kt") + public void testStepToSmallerLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepToSmallerLastThenStepOne.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSameLast.kt") + public void testStepToSmallerLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepToSmallerLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSmallerLast.kt") + public void testStepToSmallerLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepToSmallerLastThenStepToSmallerLast.kt"); + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/literal/downTo/reversed") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Reversed extends AbstractLightAnalysisModeTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInReversed() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/literal/downTo/reversed"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("reversedThenStep.kt") + public void testReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/reversed/reversedThenStep.kt"); + } + + @TestMetadata("reversedThenStepThenReversed.kt") + public void testReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/reversed/reversedThenStepThenReversed.kt"); + } + + @TestMetadata("reversedThenStepThenReversedThenStep.kt") + public void testReversedThenStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/reversed/reversedThenStepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversed.kt") + public void testStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/reversed/stepThenReversed.kt"); + } + + @TestMetadata("stepThenReversedThenStep.kt") + public void testStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/reversed/stepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversedThenStepThenReversed.kt") + public void testStepThenReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/reversed/stepThenReversedThenStepThenReversed.kt"); + } + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class RangeTo extends AbstractLightAnalysisModeTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInRangeTo() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("emptyProgression.kt") + public void testEmptyProgression() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/emptyProgression.kt"); + } + + @TestMetadata("illegalStepNegative.kt") + public void testIllegalStepNegative() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/illegalStepNegative.kt"); + } + + @TestMetadata("illegalStepNonConst.kt") + public void testIllegalStepNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/illegalStepNonConst.kt"); + } + + @TestMetadata("illegalStepThenLegalStep.kt") + public void testIllegalStepThenLegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/illegalStepThenLegalStep.kt"); + } + + @TestMetadata("illegalStepZero.kt") + public void testIllegalStepZero() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/illegalStepZero.kt"); + } + + @TestMetadata("legalStepThenIllegalStep.kt") + public void testLegalStepThenIllegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/legalStepThenIllegalStep.kt"); + } + + @TestMetadata("minValueToMaxValueStepMaxValue.kt") + public void testMinValueToMaxValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/minValueToMaxValueStepMaxValue.kt"); + } + + @TestMetadata("mixedTypeStep.kt") + public void testMixedTypeStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/mixedTypeStep.kt"); + } + + @TestMetadata("oneToMaxValueStepMaxValue.kt") + public void testOneToMaxValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/oneToMaxValueStepMaxValue.kt"); + } + + @TestMetadata("singleElementStepTwo.kt") + public void testSingleElementStepTwo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/singleElementStepTwo.kt"); + } + + @TestMetadata("stepNonConst.kt") + public void testStepNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/stepNonConst.kt"); + } + + @TestMetadata("stepOne.kt") + public void testStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/stepOne.kt"); + } + + @TestMetadata("stepToOutsideRange.kt") + public void testStepToOutsideRange() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/stepToOutsideRange.kt"); + } + + @TestMetadata("stepToSameLast.kt") + public void testStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/stepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLast.kt") + public void testStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/stepToSmallerLast.kt"); + } + + @TestMetadata("zeroToMaxValueStepMaxValue.kt") + public void testZeroToMaxValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/zeroToMaxValueStepMaxValue.kt"); + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class NestedStep extends AbstractLightAnalysisModeTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInNestedStep() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("stepOneThenStepOne.kt") + public void testStepOneThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepOneThenStepOne.kt"); + } + + @TestMetadata("stepThenSameStep.kt") + public void testStepThenSameStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepThenSameStep.kt"); + } + + @TestMetadata("stepToSameLastThenStepOne.kt") + public void testStepToSameLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepToSameLastThenStepOne.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSameLast.kt") + public void testStepToSameLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepToSameLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSmallerLast.kt") + public void testStepToSameLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepToSameLastThenStepToSmallerLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepOne.kt") + public void testStepToSmallerLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepToSmallerLastThenStepOne.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSameLast.kt") + public void testStepToSmallerLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepToSmallerLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSmallerLast.kt") + public void testStepToSmallerLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepToSmallerLastThenStepToSmallerLast.kt"); + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/reversed") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Reversed extends AbstractLightAnalysisModeTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInReversed() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/reversed"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("reversedThenStep.kt") + public void testReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/reversed/reversedThenStep.kt"); + } + + @TestMetadata("reversedThenStepThenReversed.kt") + public void testReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/reversed/reversedThenStepThenReversed.kt"); + } + + @TestMetadata("reversedThenStepThenReversedThenStep.kt") + public void testReversedThenStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/reversed/reversedThenStepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversed.kt") + public void testStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/reversed/stepThenReversed.kt"); + } + + @TestMetadata("stepThenReversedThenStep.kt") + public void testStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/reversed/stepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversedThenStepThenReversed.kt") + public void testStepThenReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/reversed/stepThenReversedThenStepThenReversed.kt"); + } + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/literal/until") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Until extends AbstractLightAnalysisModeTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInUntil() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/literal/until"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("emptyProgression.kt") + public void testEmptyProgression() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/emptyProgression.kt"); + } + + @TestMetadata("emptyProgressionToMinValue.kt") + public void testEmptyProgressionToMinValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/emptyProgressionToMinValue.kt"); + } + + @TestMetadata("illegalStepNegative.kt") + public void testIllegalStepNegative() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/illegalStepNegative.kt"); + } + + @TestMetadata("illegalStepNonConst.kt") + public void testIllegalStepNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/illegalStepNonConst.kt"); + } + + @TestMetadata("illegalStepThenLegalStep.kt") + public void testIllegalStepThenLegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/illegalStepThenLegalStep.kt"); + } + + @TestMetadata("illegalStepZero.kt") + public void testIllegalStepZero() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/illegalStepZero.kt"); + } + + @TestMetadata("legalStepThenIllegalStep.kt") + public void testLegalStepThenIllegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/legalStepThenIllegalStep.kt"); + } + + @TestMetadata("minValueToMaxValueStepMaxValue.kt") + public void testMinValueToMaxValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/minValueToMaxValueStepMaxValue.kt"); + } + + @TestMetadata("mixedTypeStep.kt") + public void testMixedTypeStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/mixedTypeStep.kt"); + } + + @TestMetadata("progressionToNonConst.kt") + public void testProgressionToNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/progressionToNonConst.kt"); + } + + @TestMetadata("singleElementStepTwo.kt") + public void testSingleElementStepTwo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/singleElementStepTwo.kt"); + } + + @TestMetadata("stepNonConst.kt") + public void testStepNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/stepNonConst.kt"); + } + + @TestMetadata("stepOne.kt") + public void testStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/stepOne.kt"); + } + + @TestMetadata("stepToOutsideRange.kt") + public void testStepToOutsideRange() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/stepToOutsideRange.kt"); + } + + @TestMetadata("stepToSameLast.kt") + public void testStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/stepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLast.kt") + public void testStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/stepToSmallerLast.kt"); + } + + @TestMetadata("zeroToMaxValueStepMaxValue.kt") + public void testZeroToMaxValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/zeroToMaxValueStepMaxValue.kt"); + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class NestedStep extends AbstractLightAnalysisModeTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInNestedStep() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("stepOneThenStepOne.kt") + public void testStepOneThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepOneThenStepOne.kt"); + } + + @TestMetadata("stepThenSameStep.kt") + public void testStepThenSameStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepThenSameStep.kt"); + } + + @TestMetadata("stepToSameLastThenStepOne.kt") + public void testStepToSameLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepToSameLastThenStepOne.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSameLast.kt") + public void testStepToSameLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepToSameLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSmallerLast.kt") + public void testStepToSameLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepToSameLastThenStepToSmallerLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepOne.kt") + public void testStepToSmallerLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepToSmallerLastThenStepOne.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSameLast.kt") + public void testStepToSmallerLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepToSmallerLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSmallerLast.kt") + public void testStepToSmallerLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepToSmallerLastThenStepToSmallerLast.kt"); + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/literal/until/reversed") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Reversed extends AbstractLightAnalysisModeTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInReversed() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/literal/until/reversed"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("reversedThenStep.kt") + public void testReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/reversed/reversedThenStep.kt"); + } + + @TestMetadata("reversedThenStepThenReversed.kt") + public void testReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/reversed/reversedThenStepThenReversed.kt"); + } + + @TestMetadata("reversedThenStepThenReversedThenStep.kt") + public void testReversedThenStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/reversed/reversedThenStepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversed.kt") + public void testStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/reversed/stepThenReversed.kt"); + } + + @TestMetadata("stepThenReversedThenStep.kt") + public void testStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/reversed/stepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversedThenStepThenReversed.kt") + public void testStepThenReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/reversed/stepThenReversedThenStepThenReversed.kt"); + } + } + } + } + } + @TestMetadata("compiler/testData/codegen/box/ranges/unsigned") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java index 98d5130831b..0a51e88c4b1 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java @@ -18212,6 +18212,178 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes public void testForInUntilReversedReversed() throws Exception { runTest("compiler/testData/codegen/box/ranges/evaluationOrder/forInUntilReversedReversed.kt"); } + + @TestMetadata("compiler/testData/codegen/box/ranges/evaluationOrder/stepped") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Stepped extends AbstractIrBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInStepped() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/evaluationOrder/stepped"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); + } + + @TestMetadata("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class ForInDownTo extends AbstractIrBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInForInDownTo() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); + } + + @TestMetadata("forInDownToReversedStep.kt") + public void testForInDownToReversedStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToReversedStep.kt"); + } + + @TestMetadata("forInDownToReversedStepReversed.kt") + public void testForInDownToReversedStepReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToReversedStepReversed.kt"); + } + + @TestMetadata("forInDownToReversedStepReversedStep.kt") + public void testForInDownToReversedStepReversedStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToReversedStepReversedStep.kt"); + } + + @TestMetadata("forInDownToStep.kt") + public void testForInDownToStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToStep.kt"); + } + + @TestMetadata("forInDownToStepReversed.kt") + public void testForInDownToStepReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToStepReversed.kt"); + } + + @TestMetadata("forInDownToStepReversedStep.kt") + public void testForInDownToStepReversedStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToStepReversedStep.kt"); + } + + @TestMetadata("forInDownToStepReversedStepReversed.kt") + public void testForInDownToStepReversedStepReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToStepReversedStepReversed.kt"); + } + + @TestMetadata("forInDownToStepStep.kt") + public void testForInDownToStepStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToStepStep.kt"); + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class ForInRangeLiteral extends AbstractIrBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInForInRangeLiteral() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); + } + + @TestMetadata("forInRangeLiteralReversedStep.kt") + public void testForInRangeLiteralReversedStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralReversedStep.kt"); + } + + @TestMetadata("forInRangeLiteralReversedStepReversed.kt") + public void testForInRangeLiteralReversedStepReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralReversedStepReversed.kt"); + } + + @TestMetadata("forInRangeLiteralReversedStepReversedStep.kt") + public void testForInRangeLiteralReversedStepReversedStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralReversedStepReversedStep.kt"); + } + + @TestMetadata("forInRangeLiteralStep.kt") + public void testForInRangeLiteralStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralStep.kt"); + } + + @TestMetadata("forInRangeLiteralStepReversed.kt") + public void testForInRangeLiteralStepReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralStepReversed.kt"); + } + + @TestMetadata("forInRangeLiteralStepReversedStep.kt") + public void testForInRangeLiteralStepReversedStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralStepReversedStep.kt"); + } + + @TestMetadata("forInRangeLiteralStepReversedStepReversed.kt") + public void testForInRangeLiteralStepReversedStepReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralStepReversedStepReversed.kt"); + } + + @TestMetadata("forInRangeLiteralStepStep.kt") + public void testForInRangeLiteralStepStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralStepStep.kt"); + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class ForInUntil extends AbstractIrBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInForInUntil() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); + } + + @TestMetadata("forInUntilReversedStep.kt") + public void testForInUntilReversedStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilReversedStep.kt"); + } + + @TestMetadata("forInUntilReversedStepReversed.kt") + public void testForInUntilReversedStepReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilReversedStepReversed.kt"); + } + + @TestMetadata("forInUntilReversedStepReversedStep.kt") + public void testForInUntilReversedStepReversedStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilReversedStepReversedStep.kt"); + } + + @TestMetadata("forInUntilStep.kt") + public void testForInUntilStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilStep.kt"); + } + + @TestMetadata("forInUntilStepReversed.kt") + public void testForInUntilStepReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilStepReversed.kt"); + } + + @TestMetadata("forInUntilStepReversedStep.kt") + public void testForInUntilStepReversedStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilStepReversedStep.kt"); + } + + @TestMetadata("forInUntilStepReversedStepReversed.kt") + public void testForInUntilStepReversedStepReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilStepReversedStepReversed.kt"); + } + + @TestMetadata("forInUntilStepStep.kt") + public void testForInUntilStepStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilStepStep.kt"); + } + } + } } @TestMetadata("compiler/testData/codegen/box/ranges/expression") @@ -18963,6 +19135,1184 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes } } + @TestMetadata("compiler/testData/codegen/box/ranges/stepped") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Stepped extends AbstractIrBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInStepped() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/expression") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Expression extends AbstractIrBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInExpression() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/expression"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/expression/downTo") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class DownTo extends AbstractIrBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInDownTo() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/expression/downTo"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); + } + + @TestMetadata("emptyProgression.kt") + public void testEmptyProgression() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/emptyProgression.kt"); + } + + @TestMetadata("illegalStepNegative.kt") + public void testIllegalStepNegative() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/illegalStepNegative.kt"); + } + + @TestMetadata("illegalStepNonConst.kt") + public void testIllegalStepNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/illegalStepNonConst.kt"); + } + + @TestMetadata("illegalStepThenLegalStep.kt") + public void testIllegalStepThenLegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/illegalStepThenLegalStep.kt"); + } + + @TestMetadata("illegalStepZero.kt") + public void testIllegalStepZero() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/illegalStepZero.kt"); + } + + @TestMetadata("legalStepThenIllegalStep.kt") + public void testLegalStepThenIllegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/legalStepThenIllegalStep.kt"); + } + + @TestMetadata("maxValueToMinValueStepMaxValue.kt") + public void testMaxValueToMinValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/maxValueToMinValueStepMaxValue.kt"); + } + + @TestMetadata("maxValueToOneStepMaxValue.kt") + public void testMaxValueToOneStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/maxValueToOneStepMaxValue.kt"); + } + + @TestMetadata("maxValueToZeroStepMaxValue.kt") + public void testMaxValueToZeroStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/maxValueToZeroStepMaxValue.kt"); + } + + @TestMetadata("mixedTypeStep.kt") + public void testMixedTypeStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/mixedTypeStep.kt"); + } + + @TestMetadata("singleElementStepTwo.kt") + public void testSingleElementStepTwo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/singleElementStepTwo.kt"); + } + + @TestMetadata("stepNonConst.kt") + public void testStepNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/stepNonConst.kt"); + } + + @TestMetadata("stepOne.kt") + public void testStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/stepOne.kt"); + } + + @TestMetadata("stepToOutsideRange.kt") + public void testStepToOutsideRange() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/stepToOutsideRange.kt"); + } + + @TestMetadata("stepToSameLast.kt") + public void testStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/stepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLast.kt") + public void testStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/stepToSmallerLast.kt"); + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class NestedStep extends AbstractIrBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInNestedStep() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); + } + + @TestMetadata("stepOneThenStepOne.kt") + public void testStepOneThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepOneThenStepOne.kt"); + } + + @TestMetadata("stepThenSameStep.kt") + public void testStepThenSameStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepThenSameStep.kt"); + } + + @TestMetadata("stepToSameLastThenStepOne.kt") + public void testStepToSameLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepToSameLastThenStepOne.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSameLast.kt") + public void testStepToSameLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepToSameLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSmallerLast.kt") + public void testStepToSameLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepToSameLastThenStepToSmallerLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepOne.kt") + public void testStepToSmallerLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepToSmallerLastThenStepOne.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSameLast.kt") + public void testStepToSmallerLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepToSmallerLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSmallerLast.kt") + public void testStepToSmallerLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepToSmallerLastThenStepToSmallerLast.kt"); + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/expression/downTo/reversed") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Reversed extends AbstractIrBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInReversed() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/expression/downTo/reversed"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); + } + + @TestMetadata("reversedThenStep.kt") + public void testReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/reversed/reversedThenStep.kt"); + } + + @TestMetadata("reversedThenStepThenReversed.kt") + public void testReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/reversed/reversedThenStepThenReversed.kt"); + } + + @TestMetadata("reversedThenStepThenReversedThenStep.kt") + public void testReversedThenStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/reversed/reversedThenStepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversed.kt") + public void testStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/reversed/stepThenReversed.kt"); + } + + @TestMetadata("stepThenReversedThenStep.kt") + public void testStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/reversed/stepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversedThenStepThenReversed.kt") + public void testStepThenReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/reversed/stepThenReversedThenStepThenReversed.kt"); + } + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class RangeTo extends AbstractIrBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInRangeTo() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); + } + + @TestMetadata("emptyProgression.kt") + public void testEmptyProgression() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/emptyProgression.kt"); + } + + @TestMetadata("illegalStepNegative.kt") + public void testIllegalStepNegative() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/illegalStepNegative.kt"); + } + + @TestMetadata("illegalStepNonConst.kt") + public void testIllegalStepNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/illegalStepNonConst.kt"); + } + + @TestMetadata("illegalStepThenLegalStep.kt") + public void testIllegalStepThenLegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/illegalStepThenLegalStep.kt"); + } + + @TestMetadata("illegalStepZero.kt") + public void testIllegalStepZero() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/illegalStepZero.kt"); + } + + @TestMetadata("legalStepThenIllegalStep.kt") + public void testLegalStepThenIllegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/legalStepThenIllegalStep.kt"); + } + + @TestMetadata("minValueToMaxValueStepMaxValue.kt") + public void testMinValueToMaxValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/minValueToMaxValueStepMaxValue.kt"); + } + + @TestMetadata("mixedTypeStep.kt") + public void testMixedTypeStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/mixedTypeStep.kt"); + } + + @TestMetadata("oneToMaxValueStepMaxValue.kt") + public void testOneToMaxValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/oneToMaxValueStepMaxValue.kt"); + } + + @TestMetadata("singleElementStepTwo.kt") + public void testSingleElementStepTwo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/singleElementStepTwo.kt"); + } + + @TestMetadata("stepNonConst.kt") + public void testStepNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/stepNonConst.kt"); + } + + @TestMetadata("stepOne.kt") + public void testStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/stepOne.kt"); + } + + @TestMetadata("stepToOutsideRange.kt") + public void testStepToOutsideRange() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/stepToOutsideRange.kt"); + } + + @TestMetadata("stepToSameLast.kt") + public void testStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/stepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLast.kt") + public void testStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/stepToSmallerLast.kt"); + } + + @TestMetadata("zeroToMaxValueStepMaxValue.kt") + public void testZeroToMaxValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/zeroToMaxValueStepMaxValue.kt"); + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class NestedStep extends AbstractIrBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInNestedStep() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); + } + + @TestMetadata("stepOneThenStepOne.kt") + public void testStepOneThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepOneThenStepOne.kt"); + } + + @TestMetadata("stepThenSameStep.kt") + public void testStepThenSameStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepThenSameStep.kt"); + } + + @TestMetadata("stepToSameLastThenStepOne.kt") + public void testStepToSameLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepToSameLastThenStepOne.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSameLast.kt") + public void testStepToSameLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepToSameLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSmallerLast.kt") + public void testStepToSameLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepToSameLastThenStepToSmallerLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepOne.kt") + public void testStepToSmallerLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepToSmallerLastThenStepOne.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSameLast.kt") + public void testStepToSmallerLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepToSmallerLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSmallerLast.kt") + public void testStepToSmallerLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepToSmallerLastThenStepToSmallerLast.kt"); + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/reversed") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Reversed extends AbstractIrBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInReversed() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/reversed"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); + } + + @TestMetadata("reversedThenStep.kt") + public void testReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/reversed/reversedThenStep.kt"); + } + + @TestMetadata("reversedThenStepThenReversed.kt") + public void testReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/reversed/reversedThenStepThenReversed.kt"); + } + + @TestMetadata("reversedThenStepThenReversedThenStep.kt") + public void testReversedThenStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/reversed/reversedThenStepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversed.kt") + public void testStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/reversed/stepThenReversed.kt"); + } + + @TestMetadata("stepThenReversedThenStep.kt") + public void testStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/reversed/stepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversedThenStepThenReversed.kt") + public void testStepThenReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/reversed/stepThenReversedThenStepThenReversed.kt"); + } + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/expression/until") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Until extends AbstractIrBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInUntil() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/expression/until"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); + } + + @TestMetadata("emptyProgression.kt") + public void testEmptyProgression() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/emptyProgression.kt"); + } + + @TestMetadata("emptyProgressionToMinValue.kt") + public void testEmptyProgressionToMinValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/emptyProgressionToMinValue.kt"); + } + + @TestMetadata("illegalStepNegative.kt") + public void testIllegalStepNegative() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/illegalStepNegative.kt"); + } + + @TestMetadata("illegalStepNonConst.kt") + public void testIllegalStepNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/illegalStepNonConst.kt"); + } + + @TestMetadata("illegalStepThenLegalStep.kt") + public void testIllegalStepThenLegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/illegalStepThenLegalStep.kt"); + } + + @TestMetadata("illegalStepZero.kt") + public void testIllegalStepZero() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/illegalStepZero.kt"); + } + + @TestMetadata("legalStepThenIllegalStep.kt") + public void testLegalStepThenIllegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/legalStepThenIllegalStep.kt"); + } + + @TestMetadata("minValueToMaxValueStepMaxValue.kt") + public void testMinValueToMaxValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/minValueToMaxValueStepMaxValue.kt"); + } + + @TestMetadata("mixedTypeStep.kt") + public void testMixedTypeStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/mixedTypeStep.kt"); + } + + @TestMetadata("singleElementStepTwo.kt") + public void testSingleElementStepTwo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/singleElementStepTwo.kt"); + } + + @TestMetadata("stepNonConst.kt") + public void testStepNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/stepNonConst.kt"); + } + + @TestMetadata("stepOne.kt") + public void testStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/stepOne.kt"); + } + + @TestMetadata("stepToOutsideRange.kt") + public void testStepToOutsideRange() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/stepToOutsideRange.kt"); + } + + @TestMetadata("stepToSameLast.kt") + public void testStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/stepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLast.kt") + public void testStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/stepToSmallerLast.kt"); + } + + @TestMetadata("zeroToMaxValueStepMaxValue.kt") + public void testZeroToMaxValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/zeroToMaxValueStepMaxValue.kt"); + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class NestedStep extends AbstractIrBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInNestedStep() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); + } + + @TestMetadata("stepOneThenStepOne.kt") + public void testStepOneThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepOneThenStepOne.kt"); + } + + @TestMetadata("stepThenSameStep.kt") + public void testStepThenSameStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepThenSameStep.kt"); + } + + @TestMetadata("stepToSameLastThenStepOne.kt") + public void testStepToSameLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepToSameLastThenStepOne.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSameLast.kt") + public void testStepToSameLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepToSameLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSmallerLast.kt") + public void testStepToSameLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepToSameLastThenStepToSmallerLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepOne.kt") + public void testStepToSmallerLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepToSmallerLastThenStepOne.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSameLast.kt") + public void testStepToSmallerLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepToSmallerLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSmallerLast.kt") + public void testStepToSmallerLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepToSmallerLastThenStepToSmallerLast.kt"); + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/expression/until/reversed") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Reversed extends AbstractIrBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInReversed() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/expression/until/reversed"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); + } + + @TestMetadata("reversedThenStep.kt") + public void testReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/reversed/reversedThenStep.kt"); + } + + @TestMetadata("reversedThenStepThenReversed.kt") + public void testReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/reversed/reversedThenStepThenReversed.kt"); + } + + @TestMetadata("reversedThenStepThenReversedThenStep.kt") + public void testReversedThenStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/reversed/reversedThenStepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversed.kt") + public void testStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/reversed/stepThenReversed.kt"); + } + + @TestMetadata("stepThenReversedThenStep.kt") + public void testStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/reversed/stepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversedThenStepThenReversed.kt") + public void testStepThenReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/reversed/stepThenReversedThenStepThenReversed.kt"); + } + } + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/literal") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Literal extends AbstractIrBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInLiteral() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/literal"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/literal/downTo") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class DownTo extends AbstractIrBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInDownTo() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/literal/downTo"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); + } + + @TestMetadata("emptyProgression.kt") + public void testEmptyProgression() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/emptyProgression.kt"); + } + + @TestMetadata("illegalStepNegative.kt") + public void testIllegalStepNegative() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/illegalStepNegative.kt"); + } + + @TestMetadata("illegalStepNonConst.kt") + public void testIllegalStepNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/illegalStepNonConst.kt"); + } + + @TestMetadata("illegalStepThenLegalStep.kt") + public void testIllegalStepThenLegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/illegalStepThenLegalStep.kt"); + } + + @TestMetadata("illegalStepZero.kt") + public void testIllegalStepZero() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/illegalStepZero.kt"); + } + + @TestMetadata("legalStepThenIllegalStep.kt") + public void testLegalStepThenIllegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/legalStepThenIllegalStep.kt"); + } + + @TestMetadata("maxValueToMinValueStepMaxValue.kt") + public void testMaxValueToMinValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/maxValueToMinValueStepMaxValue.kt"); + } + + @TestMetadata("maxValueToOneStepMaxValue.kt") + public void testMaxValueToOneStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/maxValueToOneStepMaxValue.kt"); + } + + @TestMetadata("maxValueToZeroStepMaxValue.kt") + public void testMaxValueToZeroStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/maxValueToZeroStepMaxValue.kt"); + } + + @TestMetadata("mixedTypeStep.kt") + public void testMixedTypeStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/mixedTypeStep.kt"); + } + + @TestMetadata("singleElementStepTwo.kt") + public void testSingleElementStepTwo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/singleElementStepTwo.kt"); + } + + @TestMetadata("stepNonConst.kt") + public void testStepNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/stepNonConst.kt"); + } + + @TestMetadata("stepOne.kt") + public void testStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/stepOne.kt"); + } + + @TestMetadata("stepToOutsideRange.kt") + public void testStepToOutsideRange() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/stepToOutsideRange.kt"); + } + + @TestMetadata("stepToSameLast.kt") + public void testStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/stepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLast.kt") + public void testStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/stepToSmallerLast.kt"); + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class NestedStep extends AbstractIrBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInNestedStep() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); + } + + @TestMetadata("stepOneThenStepOne.kt") + public void testStepOneThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepOneThenStepOne.kt"); + } + + @TestMetadata("stepThenSameStep.kt") + public void testStepThenSameStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepThenSameStep.kt"); + } + + @TestMetadata("stepToSameLastThenStepOne.kt") + public void testStepToSameLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepToSameLastThenStepOne.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSameLast.kt") + public void testStepToSameLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepToSameLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSmallerLast.kt") + public void testStepToSameLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepToSameLastThenStepToSmallerLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepOne.kt") + public void testStepToSmallerLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepToSmallerLastThenStepOne.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSameLast.kt") + public void testStepToSmallerLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepToSmallerLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSmallerLast.kt") + public void testStepToSmallerLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepToSmallerLastThenStepToSmallerLast.kt"); + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/literal/downTo/reversed") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Reversed extends AbstractIrBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInReversed() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/literal/downTo/reversed"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); + } + + @TestMetadata("reversedThenStep.kt") + public void testReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/reversed/reversedThenStep.kt"); + } + + @TestMetadata("reversedThenStepThenReversed.kt") + public void testReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/reversed/reversedThenStepThenReversed.kt"); + } + + @TestMetadata("reversedThenStepThenReversedThenStep.kt") + public void testReversedThenStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/reversed/reversedThenStepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversed.kt") + public void testStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/reversed/stepThenReversed.kt"); + } + + @TestMetadata("stepThenReversedThenStep.kt") + public void testStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/reversed/stepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversedThenStepThenReversed.kt") + public void testStepThenReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/reversed/stepThenReversedThenStepThenReversed.kt"); + } + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class RangeTo extends AbstractIrBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInRangeTo() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); + } + + @TestMetadata("emptyProgression.kt") + public void testEmptyProgression() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/emptyProgression.kt"); + } + + @TestMetadata("illegalStepNegative.kt") + public void testIllegalStepNegative() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/illegalStepNegative.kt"); + } + + @TestMetadata("illegalStepNonConst.kt") + public void testIllegalStepNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/illegalStepNonConst.kt"); + } + + @TestMetadata("illegalStepThenLegalStep.kt") + public void testIllegalStepThenLegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/illegalStepThenLegalStep.kt"); + } + + @TestMetadata("illegalStepZero.kt") + public void testIllegalStepZero() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/illegalStepZero.kt"); + } + + @TestMetadata("legalStepThenIllegalStep.kt") + public void testLegalStepThenIllegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/legalStepThenIllegalStep.kt"); + } + + @TestMetadata("minValueToMaxValueStepMaxValue.kt") + public void testMinValueToMaxValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/minValueToMaxValueStepMaxValue.kt"); + } + + @TestMetadata("mixedTypeStep.kt") + public void testMixedTypeStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/mixedTypeStep.kt"); + } + + @TestMetadata("oneToMaxValueStepMaxValue.kt") + public void testOneToMaxValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/oneToMaxValueStepMaxValue.kt"); + } + + @TestMetadata("singleElementStepTwo.kt") + public void testSingleElementStepTwo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/singleElementStepTwo.kt"); + } + + @TestMetadata("stepNonConst.kt") + public void testStepNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/stepNonConst.kt"); + } + + @TestMetadata("stepOne.kt") + public void testStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/stepOne.kt"); + } + + @TestMetadata("stepToOutsideRange.kt") + public void testStepToOutsideRange() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/stepToOutsideRange.kt"); + } + + @TestMetadata("stepToSameLast.kt") + public void testStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/stepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLast.kt") + public void testStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/stepToSmallerLast.kt"); + } + + @TestMetadata("zeroToMaxValueStepMaxValue.kt") + public void testZeroToMaxValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/zeroToMaxValueStepMaxValue.kt"); + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class NestedStep extends AbstractIrBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInNestedStep() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); + } + + @TestMetadata("stepOneThenStepOne.kt") + public void testStepOneThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepOneThenStepOne.kt"); + } + + @TestMetadata("stepThenSameStep.kt") + public void testStepThenSameStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepThenSameStep.kt"); + } + + @TestMetadata("stepToSameLastThenStepOne.kt") + public void testStepToSameLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepToSameLastThenStepOne.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSameLast.kt") + public void testStepToSameLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepToSameLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSmallerLast.kt") + public void testStepToSameLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepToSameLastThenStepToSmallerLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepOne.kt") + public void testStepToSmallerLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepToSmallerLastThenStepOne.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSameLast.kt") + public void testStepToSmallerLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepToSmallerLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSmallerLast.kt") + public void testStepToSmallerLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepToSmallerLastThenStepToSmallerLast.kt"); + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/reversed") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Reversed extends AbstractIrBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInReversed() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/reversed"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); + } + + @TestMetadata("reversedThenStep.kt") + public void testReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/reversed/reversedThenStep.kt"); + } + + @TestMetadata("reversedThenStepThenReversed.kt") + public void testReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/reversed/reversedThenStepThenReversed.kt"); + } + + @TestMetadata("reversedThenStepThenReversedThenStep.kt") + public void testReversedThenStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/reversed/reversedThenStepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversed.kt") + public void testStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/reversed/stepThenReversed.kt"); + } + + @TestMetadata("stepThenReversedThenStep.kt") + public void testStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/reversed/stepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversedThenStepThenReversed.kt") + public void testStepThenReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/reversed/stepThenReversedThenStepThenReversed.kt"); + } + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/literal/until") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Until extends AbstractIrBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInUntil() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/literal/until"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); + } + + @TestMetadata("emptyProgression.kt") + public void testEmptyProgression() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/emptyProgression.kt"); + } + + @TestMetadata("emptyProgressionToMinValue.kt") + public void testEmptyProgressionToMinValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/emptyProgressionToMinValue.kt"); + } + + @TestMetadata("illegalStepNegative.kt") + public void testIllegalStepNegative() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/illegalStepNegative.kt"); + } + + @TestMetadata("illegalStepNonConst.kt") + public void testIllegalStepNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/illegalStepNonConst.kt"); + } + + @TestMetadata("illegalStepThenLegalStep.kt") + public void testIllegalStepThenLegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/illegalStepThenLegalStep.kt"); + } + + @TestMetadata("illegalStepZero.kt") + public void testIllegalStepZero() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/illegalStepZero.kt"); + } + + @TestMetadata("legalStepThenIllegalStep.kt") + public void testLegalStepThenIllegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/legalStepThenIllegalStep.kt"); + } + + @TestMetadata("minValueToMaxValueStepMaxValue.kt") + public void testMinValueToMaxValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/minValueToMaxValueStepMaxValue.kt"); + } + + @TestMetadata("mixedTypeStep.kt") + public void testMixedTypeStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/mixedTypeStep.kt"); + } + + @TestMetadata("progressionToNonConst.kt") + public void testProgressionToNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/progressionToNonConst.kt"); + } + + @TestMetadata("singleElementStepTwo.kt") + public void testSingleElementStepTwo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/singleElementStepTwo.kt"); + } + + @TestMetadata("stepNonConst.kt") + public void testStepNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/stepNonConst.kt"); + } + + @TestMetadata("stepOne.kt") + public void testStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/stepOne.kt"); + } + + @TestMetadata("stepToOutsideRange.kt") + public void testStepToOutsideRange() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/stepToOutsideRange.kt"); + } + + @TestMetadata("stepToSameLast.kt") + public void testStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/stepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLast.kt") + public void testStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/stepToSmallerLast.kt"); + } + + @TestMetadata("zeroToMaxValueStepMaxValue.kt") + public void testZeroToMaxValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/zeroToMaxValueStepMaxValue.kt"); + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class NestedStep extends AbstractIrBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInNestedStep() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); + } + + @TestMetadata("stepOneThenStepOne.kt") + public void testStepOneThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepOneThenStepOne.kt"); + } + + @TestMetadata("stepThenSameStep.kt") + public void testStepThenSameStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepThenSameStep.kt"); + } + + @TestMetadata("stepToSameLastThenStepOne.kt") + public void testStepToSameLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepToSameLastThenStepOne.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSameLast.kt") + public void testStepToSameLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepToSameLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSmallerLast.kt") + public void testStepToSameLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepToSameLastThenStepToSmallerLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepOne.kt") + public void testStepToSmallerLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepToSmallerLastThenStepOne.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSameLast.kt") + public void testStepToSmallerLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepToSmallerLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSmallerLast.kt") + public void testStepToSmallerLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepToSmallerLastThenStepToSmallerLast.kt"); + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/literal/until/reversed") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Reversed extends AbstractIrBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInReversed() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/literal/until/reversed"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); + } + + @TestMetadata("reversedThenStep.kt") + public void testReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/reversed/reversedThenStep.kt"); + } + + @TestMetadata("reversedThenStepThenReversed.kt") + public void testReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/reversed/reversedThenStepThenReversed.kt"); + } + + @TestMetadata("reversedThenStepThenReversedThenStep.kt") + public void testReversedThenStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/reversed/reversedThenStepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversed.kt") + public void testStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/reversed/stepThenReversed.kt"); + } + + @TestMetadata("stepThenReversedThenStep.kt") + public void testStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/reversed/stepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversedThenStepThenReversed.kt") + public void testStepThenReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/reversed/stepThenReversedThenStepThenReversed.kt"); + } + } + } + } + } + @TestMetadata("compiler/testData/codegen/box/ranges/unsigned") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBytecodeTextTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBytecodeTextTestGenerated.java index 51260f6ec26..f271e12f7c5 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBytecodeTextTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBytecodeTextTestGenerated.java @@ -159,6 +159,11 @@ public class IrBytecodeTextTestGenerated extends AbstractIrBytecodeTextTest { runTest("compiler/testData/codegen/bytecodeText/intConstantSafeCall.kt"); } + @TestMetadata("intProgressionNoBoxing.kt") + public void testIntProgressionNoBoxing() throws Exception { + runTest("compiler/testData/codegen/bytecodeText/intProgressionNoBoxing.kt"); + } + @TestMetadata("intRangeNoBoxing.kt") public void testIntRangeNoBoxing() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intRangeNoBoxing.kt"); diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java index 851f9406bf3..a41829c835e 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java @@ -15163,6 +15163,178 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { public void testForInUntilReversedReversed() throws Exception { runTest("compiler/testData/codegen/box/ranges/evaluationOrder/forInUntilReversedReversed.kt"); } + + @TestMetadata("compiler/testData/codegen/box/ranges/evaluationOrder/stepped") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Stepped extends AbstractIrJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); + } + + public void testAllFilesPresentInStepped() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/evaluationOrder/stepped"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true); + } + + @TestMetadata("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class ForInDownTo extends AbstractIrJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); + } + + public void testAllFilesPresentInForInDownTo() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true); + } + + @TestMetadata("forInDownToReversedStep.kt") + public void testForInDownToReversedStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToReversedStep.kt"); + } + + @TestMetadata("forInDownToReversedStepReversed.kt") + public void testForInDownToReversedStepReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToReversedStepReversed.kt"); + } + + @TestMetadata("forInDownToReversedStepReversedStep.kt") + public void testForInDownToReversedStepReversedStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToReversedStepReversedStep.kt"); + } + + @TestMetadata("forInDownToStep.kt") + public void testForInDownToStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToStep.kt"); + } + + @TestMetadata("forInDownToStepReversed.kt") + public void testForInDownToStepReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToStepReversed.kt"); + } + + @TestMetadata("forInDownToStepReversedStep.kt") + public void testForInDownToStepReversedStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToStepReversedStep.kt"); + } + + @TestMetadata("forInDownToStepReversedStepReversed.kt") + public void testForInDownToStepReversedStepReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToStepReversedStepReversed.kt"); + } + + @TestMetadata("forInDownToStepStep.kt") + public void testForInDownToStepStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToStepStep.kt"); + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class ForInRangeLiteral extends AbstractIrJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); + } + + public void testAllFilesPresentInForInRangeLiteral() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true); + } + + @TestMetadata("forInRangeLiteralReversedStep.kt") + public void testForInRangeLiteralReversedStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralReversedStep.kt"); + } + + @TestMetadata("forInRangeLiteralReversedStepReversed.kt") + public void testForInRangeLiteralReversedStepReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralReversedStepReversed.kt"); + } + + @TestMetadata("forInRangeLiteralReversedStepReversedStep.kt") + public void testForInRangeLiteralReversedStepReversedStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralReversedStepReversedStep.kt"); + } + + @TestMetadata("forInRangeLiteralStep.kt") + public void testForInRangeLiteralStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralStep.kt"); + } + + @TestMetadata("forInRangeLiteralStepReversed.kt") + public void testForInRangeLiteralStepReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralStepReversed.kt"); + } + + @TestMetadata("forInRangeLiteralStepReversedStep.kt") + public void testForInRangeLiteralStepReversedStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralStepReversedStep.kt"); + } + + @TestMetadata("forInRangeLiteralStepReversedStepReversed.kt") + public void testForInRangeLiteralStepReversedStepReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralStepReversedStepReversed.kt"); + } + + @TestMetadata("forInRangeLiteralStepStep.kt") + public void testForInRangeLiteralStepStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralStepStep.kt"); + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class ForInUntil extends AbstractIrJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); + } + + public void testAllFilesPresentInForInUntil() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true); + } + + @TestMetadata("forInUntilReversedStep.kt") + public void testForInUntilReversedStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilReversedStep.kt"); + } + + @TestMetadata("forInUntilReversedStepReversed.kt") + public void testForInUntilReversedStepReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilReversedStepReversed.kt"); + } + + @TestMetadata("forInUntilReversedStepReversedStep.kt") + public void testForInUntilReversedStepReversedStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilReversedStepReversedStep.kt"); + } + + @TestMetadata("forInUntilStep.kt") + public void testForInUntilStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilStep.kt"); + } + + @TestMetadata("forInUntilStepReversed.kt") + public void testForInUntilStepReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilStepReversed.kt"); + } + + @TestMetadata("forInUntilStepReversedStep.kt") + public void testForInUntilStepReversedStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilStepReversedStep.kt"); + } + + @TestMetadata("forInUntilStepReversedStepReversed.kt") + public void testForInUntilStepReversedStepReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilStepReversedStepReversed.kt"); + } + + @TestMetadata("forInUntilStepStep.kt") + public void testForInUntilStepStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilStepStep.kt"); + } + } + } } @TestMetadata("compiler/testData/codegen/box/ranges/expression") @@ -15914,6 +16086,1184 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { } } + @TestMetadata("compiler/testData/codegen/box/ranges/stepped") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Stepped extends AbstractIrJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); + } + + public void testAllFilesPresentInStepped() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true); + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/expression") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Expression extends AbstractIrJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); + } + + public void testAllFilesPresentInExpression() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/expression"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true); + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/expression/downTo") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class DownTo extends AbstractIrJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); + } + + public void testAllFilesPresentInDownTo() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/expression/downTo"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true); + } + + @TestMetadata("emptyProgression.kt") + public void testEmptyProgression() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/emptyProgression.kt"); + } + + @TestMetadata("illegalStepNegative.kt") + public void testIllegalStepNegative() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/illegalStepNegative.kt"); + } + + @TestMetadata("illegalStepNonConst.kt") + public void testIllegalStepNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/illegalStepNonConst.kt"); + } + + @TestMetadata("illegalStepThenLegalStep.kt") + public void testIllegalStepThenLegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/illegalStepThenLegalStep.kt"); + } + + @TestMetadata("illegalStepZero.kt") + public void testIllegalStepZero() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/illegalStepZero.kt"); + } + + @TestMetadata("legalStepThenIllegalStep.kt") + public void testLegalStepThenIllegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/legalStepThenIllegalStep.kt"); + } + + @TestMetadata("maxValueToMinValueStepMaxValue.kt") + public void testMaxValueToMinValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/maxValueToMinValueStepMaxValue.kt"); + } + + @TestMetadata("maxValueToOneStepMaxValue.kt") + public void testMaxValueToOneStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/maxValueToOneStepMaxValue.kt"); + } + + @TestMetadata("maxValueToZeroStepMaxValue.kt") + public void testMaxValueToZeroStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/maxValueToZeroStepMaxValue.kt"); + } + + @TestMetadata("mixedTypeStep.kt") + public void testMixedTypeStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/mixedTypeStep.kt"); + } + + @TestMetadata("singleElementStepTwo.kt") + public void testSingleElementStepTwo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/singleElementStepTwo.kt"); + } + + @TestMetadata("stepNonConst.kt") + public void testStepNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/stepNonConst.kt"); + } + + @TestMetadata("stepOne.kt") + public void testStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/stepOne.kt"); + } + + @TestMetadata("stepToOutsideRange.kt") + public void testStepToOutsideRange() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/stepToOutsideRange.kt"); + } + + @TestMetadata("stepToSameLast.kt") + public void testStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/stepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLast.kt") + public void testStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/stepToSmallerLast.kt"); + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class NestedStep extends AbstractIrJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); + } + + public void testAllFilesPresentInNestedStep() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true); + } + + @TestMetadata("stepOneThenStepOne.kt") + public void testStepOneThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepOneThenStepOne.kt"); + } + + @TestMetadata("stepThenSameStep.kt") + public void testStepThenSameStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepThenSameStep.kt"); + } + + @TestMetadata("stepToSameLastThenStepOne.kt") + public void testStepToSameLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepToSameLastThenStepOne.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSameLast.kt") + public void testStepToSameLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepToSameLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSmallerLast.kt") + public void testStepToSameLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepToSameLastThenStepToSmallerLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepOne.kt") + public void testStepToSmallerLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepToSmallerLastThenStepOne.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSameLast.kt") + public void testStepToSmallerLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepToSmallerLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSmallerLast.kt") + public void testStepToSmallerLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepToSmallerLastThenStepToSmallerLast.kt"); + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/expression/downTo/reversed") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Reversed extends AbstractIrJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); + } + + public void testAllFilesPresentInReversed() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/expression/downTo/reversed"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true); + } + + @TestMetadata("reversedThenStep.kt") + public void testReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/reversed/reversedThenStep.kt"); + } + + @TestMetadata("reversedThenStepThenReversed.kt") + public void testReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/reversed/reversedThenStepThenReversed.kt"); + } + + @TestMetadata("reversedThenStepThenReversedThenStep.kt") + public void testReversedThenStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/reversed/reversedThenStepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversed.kt") + public void testStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/reversed/stepThenReversed.kt"); + } + + @TestMetadata("stepThenReversedThenStep.kt") + public void testStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/reversed/stepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversedThenStepThenReversed.kt") + public void testStepThenReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/reversed/stepThenReversedThenStepThenReversed.kt"); + } + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class RangeTo extends AbstractIrJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); + } + + public void testAllFilesPresentInRangeTo() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true); + } + + @TestMetadata("emptyProgression.kt") + public void testEmptyProgression() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/emptyProgression.kt"); + } + + @TestMetadata("illegalStepNegative.kt") + public void testIllegalStepNegative() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/illegalStepNegative.kt"); + } + + @TestMetadata("illegalStepNonConst.kt") + public void testIllegalStepNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/illegalStepNonConst.kt"); + } + + @TestMetadata("illegalStepThenLegalStep.kt") + public void testIllegalStepThenLegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/illegalStepThenLegalStep.kt"); + } + + @TestMetadata("illegalStepZero.kt") + public void testIllegalStepZero() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/illegalStepZero.kt"); + } + + @TestMetadata("legalStepThenIllegalStep.kt") + public void testLegalStepThenIllegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/legalStepThenIllegalStep.kt"); + } + + @TestMetadata("minValueToMaxValueStepMaxValue.kt") + public void testMinValueToMaxValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/minValueToMaxValueStepMaxValue.kt"); + } + + @TestMetadata("mixedTypeStep.kt") + public void testMixedTypeStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/mixedTypeStep.kt"); + } + + @TestMetadata("oneToMaxValueStepMaxValue.kt") + public void testOneToMaxValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/oneToMaxValueStepMaxValue.kt"); + } + + @TestMetadata("singleElementStepTwo.kt") + public void testSingleElementStepTwo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/singleElementStepTwo.kt"); + } + + @TestMetadata("stepNonConst.kt") + public void testStepNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/stepNonConst.kt"); + } + + @TestMetadata("stepOne.kt") + public void testStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/stepOne.kt"); + } + + @TestMetadata("stepToOutsideRange.kt") + public void testStepToOutsideRange() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/stepToOutsideRange.kt"); + } + + @TestMetadata("stepToSameLast.kt") + public void testStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/stepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLast.kt") + public void testStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/stepToSmallerLast.kt"); + } + + @TestMetadata("zeroToMaxValueStepMaxValue.kt") + public void testZeroToMaxValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/zeroToMaxValueStepMaxValue.kt"); + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class NestedStep extends AbstractIrJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); + } + + public void testAllFilesPresentInNestedStep() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true); + } + + @TestMetadata("stepOneThenStepOne.kt") + public void testStepOneThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepOneThenStepOne.kt"); + } + + @TestMetadata("stepThenSameStep.kt") + public void testStepThenSameStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepThenSameStep.kt"); + } + + @TestMetadata("stepToSameLastThenStepOne.kt") + public void testStepToSameLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepToSameLastThenStepOne.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSameLast.kt") + public void testStepToSameLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepToSameLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSmallerLast.kt") + public void testStepToSameLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepToSameLastThenStepToSmallerLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepOne.kt") + public void testStepToSmallerLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepToSmallerLastThenStepOne.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSameLast.kt") + public void testStepToSmallerLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepToSmallerLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSmallerLast.kt") + public void testStepToSmallerLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepToSmallerLastThenStepToSmallerLast.kt"); + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/reversed") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Reversed extends AbstractIrJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); + } + + public void testAllFilesPresentInReversed() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/reversed"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true); + } + + @TestMetadata("reversedThenStep.kt") + public void testReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/reversed/reversedThenStep.kt"); + } + + @TestMetadata("reversedThenStepThenReversed.kt") + public void testReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/reversed/reversedThenStepThenReversed.kt"); + } + + @TestMetadata("reversedThenStepThenReversedThenStep.kt") + public void testReversedThenStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/reversed/reversedThenStepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversed.kt") + public void testStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/reversed/stepThenReversed.kt"); + } + + @TestMetadata("stepThenReversedThenStep.kt") + public void testStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/reversed/stepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversedThenStepThenReversed.kt") + public void testStepThenReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/reversed/stepThenReversedThenStepThenReversed.kt"); + } + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/expression/until") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Until extends AbstractIrJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); + } + + public void testAllFilesPresentInUntil() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/expression/until"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true); + } + + @TestMetadata("emptyProgression.kt") + public void testEmptyProgression() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/emptyProgression.kt"); + } + + @TestMetadata("emptyProgressionToMinValue.kt") + public void testEmptyProgressionToMinValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/emptyProgressionToMinValue.kt"); + } + + @TestMetadata("illegalStepNegative.kt") + public void testIllegalStepNegative() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/illegalStepNegative.kt"); + } + + @TestMetadata("illegalStepNonConst.kt") + public void testIllegalStepNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/illegalStepNonConst.kt"); + } + + @TestMetadata("illegalStepThenLegalStep.kt") + public void testIllegalStepThenLegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/illegalStepThenLegalStep.kt"); + } + + @TestMetadata("illegalStepZero.kt") + public void testIllegalStepZero() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/illegalStepZero.kt"); + } + + @TestMetadata("legalStepThenIllegalStep.kt") + public void testLegalStepThenIllegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/legalStepThenIllegalStep.kt"); + } + + @TestMetadata("minValueToMaxValueStepMaxValue.kt") + public void testMinValueToMaxValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/minValueToMaxValueStepMaxValue.kt"); + } + + @TestMetadata("mixedTypeStep.kt") + public void testMixedTypeStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/mixedTypeStep.kt"); + } + + @TestMetadata("singleElementStepTwo.kt") + public void testSingleElementStepTwo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/singleElementStepTwo.kt"); + } + + @TestMetadata("stepNonConst.kt") + public void testStepNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/stepNonConst.kt"); + } + + @TestMetadata("stepOne.kt") + public void testStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/stepOne.kt"); + } + + @TestMetadata("stepToOutsideRange.kt") + public void testStepToOutsideRange() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/stepToOutsideRange.kt"); + } + + @TestMetadata("stepToSameLast.kt") + public void testStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/stepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLast.kt") + public void testStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/stepToSmallerLast.kt"); + } + + @TestMetadata("zeroToMaxValueStepMaxValue.kt") + public void testZeroToMaxValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/zeroToMaxValueStepMaxValue.kt"); + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class NestedStep extends AbstractIrJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); + } + + public void testAllFilesPresentInNestedStep() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true); + } + + @TestMetadata("stepOneThenStepOne.kt") + public void testStepOneThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepOneThenStepOne.kt"); + } + + @TestMetadata("stepThenSameStep.kt") + public void testStepThenSameStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepThenSameStep.kt"); + } + + @TestMetadata("stepToSameLastThenStepOne.kt") + public void testStepToSameLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepToSameLastThenStepOne.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSameLast.kt") + public void testStepToSameLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepToSameLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSmallerLast.kt") + public void testStepToSameLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepToSameLastThenStepToSmallerLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepOne.kt") + public void testStepToSmallerLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepToSmallerLastThenStepOne.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSameLast.kt") + public void testStepToSmallerLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepToSmallerLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSmallerLast.kt") + public void testStepToSmallerLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepToSmallerLastThenStepToSmallerLast.kt"); + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/expression/until/reversed") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Reversed extends AbstractIrJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); + } + + public void testAllFilesPresentInReversed() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/expression/until/reversed"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true); + } + + @TestMetadata("reversedThenStep.kt") + public void testReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/reversed/reversedThenStep.kt"); + } + + @TestMetadata("reversedThenStepThenReversed.kt") + public void testReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/reversed/reversedThenStepThenReversed.kt"); + } + + @TestMetadata("reversedThenStepThenReversedThenStep.kt") + public void testReversedThenStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/reversed/reversedThenStepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversed.kt") + public void testStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/reversed/stepThenReversed.kt"); + } + + @TestMetadata("stepThenReversedThenStep.kt") + public void testStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/reversed/stepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversedThenStepThenReversed.kt") + public void testStepThenReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/reversed/stepThenReversedThenStepThenReversed.kt"); + } + } + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/literal") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Literal extends AbstractIrJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); + } + + public void testAllFilesPresentInLiteral() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/literal"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true); + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/literal/downTo") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class DownTo extends AbstractIrJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); + } + + public void testAllFilesPresentInDownTo() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/literal/downTo"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true); + } + + @TestMetadata("emptyProgression.kt") + public void testEmptyProgression() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/emptyProgression.kt"); + } + + @TestMetadata("illegalStepNegative.kt") + public void testIllegalStepNegative() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/illegalStepNegative.kt"); + } + + @TestMetadata("illegalStepNonConst.kt") + public void testIllegalStepNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/illegalStepNonConst.kt"); + } + + @TestMetadata("illegalStepThenLegalStep.kt") + public void testIllegalStepThenLegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/illegalStepThenLegalStep.kt"); + } + + @TestMetadata("illegalStepZero.kt") + public void testIllegalStepZero() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/illegalStepZero.kt"); + } + + @TestMetadata("legalStepThenIllegalStep.kt") + public void testLegalStepThenIllegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/legalStepThenIllegalStep.kt"); + } + + @TestMetadata("maxValueToMinValueStepMaxValue.kt") + public void testMaxValueToMinValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/maxValueToMinValueStepMaxValue.kt"); + } + + @TestMetadata("maxValueToOneStepMaxValue.kt") + public void testMaxValueToOneStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/maxValueToOneStepMaxValue.kt"); + } + + @TestMetadata("maxValueToZeroStepMaxValue.kt") + public void testMaxValueToZeroStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/maxValueToZeroStepMaxValue.kt"); + } + + @TestMetadata("mixedTypeStep.kt") + public void testMixedTypeStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/mixedTypeStep.kt"); + } + + @TestMetadata("singleElementStepTwo.kt") + public void testSingleElementStepTwo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/singleElementStepTwo.kt"); + } + + @TestMetadata("stepNonConst.kt") + public void testStepNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/stepNonConst.kt"); + } + + @TestMetadata("stepOne.kt") + public void testStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/stepOne.kt"); + } + + @TestMetadata("stepToOutsideRange.kt") + public void testStepToOutsideRange() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/stepToOutsideRange.kt"); + } + + @TestMetadata("stepToSameLast.kt") + public void testStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/stepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLast.kt") + public void testStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/stepToSmallerLast.kt"); + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class NestedStep extends AbstractIrJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); + } + + public void testAllFilesPresentInNestedStep() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true); + } + + @TestMetadata("stepOneThenStepOne.kt") + public void testStepOneThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepOneThenStepOne.kt"); + } + + @TestMetadata("stepThenSameStep.kt") + public void testStepThenSameStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepThenSameStep.kt"); + } + + @TestMetadata("stepToSameLastThenStepOne.kt") + public void testStepToSameLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepToSameLastThenStepOne.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSameLast.kt") + public void testStepToSameLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepToSameLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSmallerLast.kt") + public void testStepToSameLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepToSameLastThenStepToSmallerLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepOne.kt") + public void testStepToSmallerLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepToSmallerLastThenStepOne.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSameLast.kt") + public void testStepToSmallerLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepToSmallerLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSmallerLast.kt") + public void testStepToSmallerLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepToSmallerLastThenStepToSmallerLast.kt"); + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/literal/downTo/reversed") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Reversed extends AbstractIrJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); + } + + public void testAllFilesPresentInReversed() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/literal/downTo/reversed"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true); + } + + @TestMetadata("reversedThenStep.kt") + public void testReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/reversed/reversedThenStep.kt"); + } + + @TestMetadata("reversedThenStepThenReversed.kt") + public void testReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/reversed/reversedThenStepThenReversed.kt"); + } + + @TestMetadata("reversedThenStepThenReversedThenStep.kt") + public void testReversedThenStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/reversed/reversedThenStepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversed.kt") + public void testStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/reversed/stepThenReversed.kt"); + } + + @TestMetadata("stepThenReversedThenStep.kt") + public void testStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/reversed/stepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversedThenStepThenReversed.kt") + public void testStepThenReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/reversed/stepThenReversedThenStepThenReversed.kt"); + } + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class RangeTo extends AbstractIrJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); + } + + public void testAllFilesPresentInRangeTo() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true); + } + + @TestMetadata("emptyProgression.kt") + public void testEmptyProgression() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/emptyProgression.kt"); + } + + @TestMetadata("illegalStepNegative.kt") + public void testIllegalStepNegative() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/illegalStepNegative.kt"); + } + + @TestMetadata("illegalStepNonConst.kt") + public void testIllegalStepNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/illegalStepNonConst.kt"); + } + + @TestMetadata("illegalStepThenLegalStep.kt") + public void testIllegalStepThenLegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/illegalStepThenLegalStep.kt"); + } + + @TestMetadata("illegalStepZero.kt") + public void testIllegalStepZero() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/illegalStepZero.kt"); + } + + @TestMetadata("legalStepThenIllegalStep.kt") + public void testLegalStepThenIllegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/legalStepThenIllegalStep.kt"); + } + + @TestMetadata("minValueToMaxValueStepMaxValue.kt") + public void testMinValueToMaxValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/minValueToMaxValueStepMaxValue.kt"); + } + + @TestMetadata("mixedTypeStep.kt") + public void testMixedTypeStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/mixedTypeStep.kt"); + } + + @TestMetadata("oneToMaxValueStepMaxValue.kt") + public void testOneToMaxValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/oneToMaxValueStepMaxValue.kt"); + } + + @TestMetadata("singleElementStepTwo.kt") + public void testSingleElementStepTwo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/singleElementStepTwo.kt"); + } + + @TestMetadata("stepNonConst.kt") + public void testStepNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/stepNonConst.kt"); + } + + @TestMetadata("stepOne.kt") + public void testStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/stepOne.kt"); + } + + @TestMetadata("stepToOutsideRange.kt") + public void testStepToOutsideRange() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/stepToOutsideRange.kt"); + } + + @TestMetadata("stepToSameLast.kt") + public void testStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/stepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLast.kt") + public void testStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/stepToSmallerLast.kt"); + } + + @TestMetadata("zeroToMaxValueStepMaxValue.kt") + public void testZeroToMaxValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/zeroToMaxValueStepMaxValue.kt"); + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class NestedStep extends AbstractIrJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); + } + + public void testAllFilesPresentInNestedStep() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true); + } + + @TestMetadata("stepOneThenStepOne.kt") + public void testStepOneThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepOneThenStepOne.kt"); + } + + @TestMetadata("stepThenSameStep.kt") + public void testStepThenSameStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepThenSameStep.kt"); + } + + @TestMetadata("stepToSameLastThenStepOne.kt") + public void testStepToSameLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepToSameLastThenStepOne.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSameLast.kt") + public void testStepToSameLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepToSameLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSmallerLast.kt") + public void testStepToSameLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepToSameLastThenStepToSmallerLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepOne.kt") + public void testStepToSmallerLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepToSmallerLastThenStepOne.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSameLast.kt") + public void testStepToSmallerLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepToSmallerLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSmallerLast.kt") + public void testStepToSmallerLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepToSmallerLastThenStepToSmallerLast.kt"); + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/reversed") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Reversed extends AbstractIrJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); + } + + public void testAllFilesPresentInReversed() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/reversed"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true); + } + + @TestMetadata("reversedThenStep.kt") + public void testReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/reversed/reversedThenStep.kt"); + } + + @TestMetadata("reversedThenStepThenReversed.kt") + public void testReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/reversed/reversedThenStepThenReversed.kt"); + } + + @TestMetadata("reversedThenStepThenReversedThenStep.kt") + public void testReversedThenStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/reversed/reversedThenStepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversed.kt") + public void testStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/reversed/stepThenReversed.kt"); + } + + @TestMetadata("stepThenReversedThenStep.kt") + public void testStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/reversed/stepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversedThenStepThenReversed.kt") + public void testStepThenReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/reversed/stepThenReversedThenStepThenReversed.kt"); + } + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/literal/until") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Until extends AbstractIrJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); + } + + public void testAllFilesPresentInUntil() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/literal/until"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true); + } + + @TestMetadata("emptyProgression.kt") + public void testEmptyProgression() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/emptyProgression.kt"); + } + + @TestMetadata("emptyProgressionToMinValue.kt") + public void testEmptyProgressionToMinValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/emptyProgressionToMinValue.kt"); + } + + @TestMetadata("illegalStepNegative.kt") + public void testIllegalStepNegative() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/illegalStepNegative.kt"); + } + + @TestMetadata("illegalStepNonConst.kt") + public void testIllegalStepNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/illegalStepNonConst.kt"); + } + + @TestMetadata("illegalStepThenLegalStep.kt") + public void testIllegalStepThenLegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/illegalStepThenLegalStep.kt"); + } + + @TestMetadata("illegalStepZero.kt") + public void testIllegalStepZero() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/illegalStepZero.kt"); + } + + @TestMetadata("legalStepThenIllegalStep.kt") + public void testLegalStepThenIllegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/legalStepThenIllegalStep.kt"); + } + + @TestMetadata("minValueToMaxValueStepMaxValue.kt") + public void testMinValueToMaxValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/minValueToMaxValueStepMaxValue.kt"); + } + + @TestMetadata("mixedTypeStep.kt") + public void testMixedTypeStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/mixedTypeStep.kt"); + } + + @TestMetadata("progressionToNonConst.kt") + public void testProgressionToNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/progressionToNonConst.kt"); + } + + @TestMetadata("singleElementStepTwo.kt") + public void testSingleElementStepTwo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/singleElementStepTwo.kt"); + } + + @TestMetadata("stepNonConst.kt") + public void testStepNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/stepNonConst.kt"); + } + + @TestMetadata("stepOne.kt") + public void testStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/stepOne.kt"); + } + + @TestMetadata("stepToOutsideRange.kt") + public void testStepToOutsideRange() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/stepToOutsideRange.kt"); + } + + @TestMetadata("stepToSameLast.kt") + public void testStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/stepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLast.kt") + public void testStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/stepToSmallerLast.kt"); + } + + @TestMetadata("zeroToMaxValueStepMaxValue.kt") + public void testZeroToMaxValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/zeroToMaxValueStepMaxValue.kt"); + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class NestedStep extends AbstractIrJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); + } + + public void testAllFilesPresentInNestedStep() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true); + } + + @TestMetadata("stepOneThenStepOne.kt") + public void testStepOneThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepOneThenStepOne.kt"); + } + + @TestMetadata("stepThenSameStep.kt") + public void testStepThenSameStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepThenSameStep.kt"); + } + + @TestMetadata("stepToSameLastThenStepOne.kt") + public void testStepToSameLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepToSameLastThenStepOne.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSameLast.kt") + public void testStepToSameLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepToSameLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSmallerLast.kt") + public void testStepToSameLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepToSameLastThenStepToSmallerLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepOne.kt") + public void testStepToSmallerLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepToSmallerLastThenStepOne.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSameLast.kt") + public void testStepToSmallerLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepToSmallerLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSmallerLast.kt") + public void testStepToSmallerLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepToSmallerLastThenStepToSmallerLast.kt"); + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/literal/until/reversed") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Reversed extends AbstractIrJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); + } + + public void testAllFilesPresentInReversed() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/literal/until/reversed"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true); + } + + @TestMetadata("reversedThenStep.kt") + public void testReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/reversed/reversedThenStep.kt"); + } + + @TestMetadata("reversedThenStepThenReversed.kt") + public void testReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/reversed/reversedThenStepThenReversed.kt"); + } + + @TestMetadata("reversedThenStepThenReversedThenStep.kt") + public void testReversedThenStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/reversed/reversedThenStepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversed.kt") + public void testStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/reversed/stepThenReversed.kt"); + } + + @TestMetadata("stepThenReversedThenStep.kt") + public void testStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/reversed/stepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversedThenStepThenReversed.kt") + public void testStepThenReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/reversed/stepThenReversedThenStepThenReversed.kt"); + } + } + } + } + } + @TestMetadata("compiler/testData/codegen/box/ranges/unsigned") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java index 9db812c71ec..4685e1dd88c 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java @@ -16318,6 +16318,178 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { public void testForInUntilReversedReversed() throws Exception { runTest("compiler/testData/codegen/box/ranges/evaluationOrder/forInUntilReversedReversed.kt"); } + + @TestMetadata("compiler/testData/codegen/box/ranges/evaluationOrder/stepped") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Stepped extends AbstractJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); + } + + public void testAllFilesPresentInStepped() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/evaluationOrder/stepped"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); + } + + @TestMetadata("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class ForInDownTo extends AbstractJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); + } + + public void testAllFilesPresentInForInDownTo() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); + } + + @TestMetadata("forInDownToReversedStep.kt") + public void testForInDownToReversedStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToReversedStep.kt"); + } + + @TestMetadata("forInDownToReversedStepReversed.kt") + public void testForInDownToReversedStepReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToReversedStepReversed.kt"); + } + + @TestMetadata("forInDownToReversedStepReversedStep.kt") + public void testForInDownToReversedStepReversedStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToReversedStepReversedStep.kt"); + } + + @TestMetadata("forInDownToStep.kt") + public void testForInDownToStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToStep.kt"); + } + + @TestMetadata("forInDownToStepReversed.kt") + public void testForInDownToStepReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToStepReversed.kt"); + } + + @TestMetadata("forInDownToStepReversedStep.kt") + public void testForInDownToStepReversedStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToStepReversedStep.kt"); + } + + @TestMetadata("forInDownToStepReversedStepReversed.kt") + public void testForInDownToStepReversedStepReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToStepReversedStepReversed.kt"); + } + + @TestMetadata("forInDownToStepStep.kt") + public void testForInDownToStepStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInDownTo/forInDownToStepStep.kt"); + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class ForInRangeLiteral extends AbstractJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); + } + + public void testAllFilesPresentInForInRangeLiteral() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); + } + + @TestMetadata("forInRangeLiteralReversedStep.kt") + public void testForInRangeLiteralReversedStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralReversedStep.kt"); + } + + @TestMetadata("forInRangeLiteralReversedStepReversed.kt") + public void testForInRangeLiteralReversedStepReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralReversedStepReversed.kt"); + } + + @TestMetadata("forInRangeLiteralReversedStepReversedStep.kt") + public void testForInRangeLiteralReversedStepReversedStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralReversedStepReversedStep.kt"); + } + + @TestMetadata("forInRangeLiteralStep.kt") + public void testForInRangeLiteralStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralStep.kt"); + } + + @TestMetadata("forInRangeLiteralStepReversed.kt") + public void testForInRangeLiteralStepReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralStepReversed.kt"); + } + + @TestMetadata("forInRangeLiteralStepReversedStep.kt") + public void testForInRangeLiteralStepReversedStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralStepReversedStep.kt"); + } + + @TestMetadata("forInRangeLiteralStepReversedStepReversed.kt") + public void testForInRangeLiteralStepReversedStepReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralStepReversedStepReversed.kt"); + } + + @TestMetadata("forInRangeLiteralStepStep.kt") + public void testForInRangeLiteralStepStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInRangeLiteral/forInRangeLiteralStepStep.kt"); + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class ForInUntil extends AbstractJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); + } + + public void testAllFilesPresentInForInUntil() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); + } + + @TestMetadata("forInUntilReversedStep.kt") + public void testForInUntilReversedStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilReversedStep.kt"); + } + + @TestMetadata("forInUntilReversedStepReversed.kt") + public void testForInUntilReversedStepReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilReversedStepReversed.kt"); + } + + @TestMetadata("forInUntilReversedStepReversedStep.kt") + public void testForInUntilReversedStepReversedStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilReversedStepReversedStep.kt"); + } + + @TestMetadata("forInUntilStep.kt") + public void testForInUntilStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilStep.kt"); + } + + @TestMetadata("forInUntilStepReversed.kt") + public void testForInUntilStepReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilStepReversed.kt"); + } + + @TestMetadata("forInUntilStepReversedStep.kt") + public void testForInUntilStepReversedStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilStepReversedStep.kt"); + } + + @TestMetadata("forInUntilStepReversedStepReversed.kt") + public void testForInUntilStepReversedStepReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilStepReversedStepReversed.kt"); + } + + @TestMetadata("forInUntilStepStep.kt") + public void testForInUntilStepStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/evaluationOrder/stepped/forInUntil/forInUntilStepStep.kt"); + } + } + } } @TestMetadata("compiler/testData/codegen/box/ranges/expression") @@ -17069,6 +17241,1139 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { } } + @TestMetadata("compiler/testData/codegen/box/ranges/stepped") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Stepped extends AbstractJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); + } + + public void testAllFilesPresentInStepped() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/expression") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Expression extends AbstractJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); + } + + public void testAllFilesPresentInExpression() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/expression"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/expression/downTo") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class DownTo extends AbstractJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); + } + + public void testAllFilesPresentInDownTo() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/expression/downTo"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); + } + + @TestMetadata("emptyProgression.kt") + public void testEmptyProgression() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/emptyProgression.kt"); + } + + @TestMetadata("illegalStepNegative.kt") + public void testIllegalStepNegative() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/illegalStepNegative.kt"); + } + + @TestMetadata("illegalStepNonConst.kt") + public void testIllegalStepNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/illegalStepNonConst.kt"); + } + + @TestMetadata("illegalStepThenLegalStep.kt") + public void testIllegalStepThenLegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/illegalStepThenLegalStep.kt"); + } + + @TestMetadata("illegalStepZero.kt") + public void testIllegalStepZero() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/illegalStepZero.kt"); + } + + @TestMetadata("legalStepThenIllegalStep.kt") + public void testLegalStepThenIllegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/legalStepThenIllegalStep.kt"); + } + + @TestMetadata("maxValueToMinValueStepMaxValue.kt") + public void testMaxValueToMinValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/maxValueToMinValueStepMaxValue.kt"); + } + + @TestMetadata("maxValueToOneStepMaxValue.kt") + public void testMaxValueToOneStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/maxValueToOneStepMaxValue.kt"); + } + + @TestMetadata("maxValueToZeroStepMaxValue.kt") + public void testMaxValueToZeroStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/maxValueToZeroStepMaxValue.kt"); + } + + @TestMetadata("mixedTypeStep.kt") + public void testMixedTypeStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/mixedTypeStep.kt"); + } + + @TestMetadata("singleElementStepTwo.kt") + public void testSingleElementStepTwo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/singleElementStepTwo.kt"); + } + + @TestMetadata("stepNonConst.kt") + public void testStepNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/stepNonConst.kt"); + } + + @TestMetadata("stepOne.kt") + public void testStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/stepOne.kt"); + } + + @TestMetadata("stepToOutsideRange.kt") + public void testStepToOutsideRange() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/stepToOutsideRange.kt"); + } + + @TestMetadata("stepToSameLast.kt") + public void testStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/stepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLast.kt") + public void testStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/stepToSmallerLast.kt"); + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class NestedStep extends AbstractJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); + } + + public void testAllFilesPresentInNestedStep() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); + } + + @TestMetadata("stepOneThenStepOne.kt") + public void testStepOneThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepOneThenStepOne.kt"); + } + + @TestMetadata("stepThenSameStep.kt") + public void testStepThenSameStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepThenSameStep.kt"); + } + + @TestMetadata("stepToSameLastThenStepOne.kt") + public void testStepToSameLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepToSameLastThenStepOne.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSameLast.kt") + public void testStepToSameLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepToSameLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSmallerLast.kt") + public void testStepToSameLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepToSameLastThenStepToSmallerLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepOne.kt") + public void testStepToSmallerLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepToSmallerLastThenStepOne.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSameLast.kt") + public void testStepToSmallerLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepToSmallerLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSmallerLast.kt") + public void testStepToSmallerLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/nestedStep/stepToSmallerLastThenStepToSmallerLast.kt"); + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/expression/downTo/reversed") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Reversed extends AbstractJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); + } + + public void testAllFilesPresentInReversed() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/expression/downTo/reversed"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); + } + + @TestMetadata("reversedThenStep.kt") + public void testReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/reversed/reversedThenStep.kt"); + } + + @TestMetadata("reversedThenStepThenReversed.kt") + public void testReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/reversed/reversedThenStepThenReversed.kt"); + } + + @TestMetadata("reversedThenStepThenReversedThenStep.kt") + public void testReversedThenStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/reversed/reversedThenStepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversed.kt") + public void testStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/reversed/stepThenReversed.kt"); + } + + @TestMetadata("stepThenReversedThenStep.kt") + public void testStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/reversed/stepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversedThenStepThenReversed.kt") + public void testStepThenReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/downTo/reversed/stepThenReversedThenStepThenReversed.kt"); + } + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class RangeTo extends AbstractJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); + } + + public void testAllFilesPresentInRangeTo() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); + } + + @TestMetadata("emptyProgression.kt") + public void testEmptyProgression() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/emptyProgression.kt"); + } + + @TestMetadata("illegalStepNegative.kt") + public void testIllegalStepNegative() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/illegalStepNegative.kt"); + } + + @TestMetadata("illegalStepNonConst.kt") + public void testIllegalStepNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/illegalStepNonConst.kt"); + } + + @TestMetadata("illegalStepThenLegalStep.kt") + public void testIllegalStepThenLegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/illegalStepThenLegalStep.kt"); + } + + @TestMetadata("illegalStepZero.kt") + public void testIllegalStepZero() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/illegalStepZero.kt"); + } + + @TestMetadata("legalStepThenIllegalStep.kt") + public void testLegalStepThenIllegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/legalStepThenIllegalStep.kt"); + } + + @TestMetadata("minValueToMaxValueStepMaxValue.kt") + public void testMinValueToMaxValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/minValueToMaxValueStepMaxValue.kt"); + } + + @TestMetadata("mixedTypeStep.kt") + public void testMixedTypeStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/mixedTypeStep.kt"); + } + + @TestMetadata("oneToMaxValueStepMaxValue.kt") + public void testOneToMaxValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/oneToMaxValueStepMaxValue.kt"); + } + + @TestMetadata("singleElementStepTwo.kt") + public void testSingleElementStepTwo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/singleElementStepTwo.kt"); + } + + @TestMetadata("stepNonConst.kt") + public void testStepNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/stepNonConst.kt"); + } + + @TestMetadata("stepOne.kt") + public void testStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/stepOne.kt"); + } + + @TestMetadata("stepToOutsideRange.kt") + public void testStepToOutsideRange() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/stepToOutsideRange.kt"); + } + + @TestMetadata("stepToSameLast.kt") + public void testStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/stepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLast.kt") + public void testStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/stepToSmallerLast.kt"); + } + + @TestMetadata("zeroToMaxValueStepMaxValue.kt") + public void testZeroToMaxValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/zeroToMaxValueStepMaxValue.kt"); + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class NestedStep extends AbstractJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); + } + + public void testAllFilesPresentInNestedStep() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); + } + + @TestMetadata("stepOneThenStepOne.kt") + public void testStepOneThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepOneThenStepOne.kt"); + } + + @TestMetadata("stepThenSameStep.kt") + public void testStepThenSameStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepThenSameStep.kt"); + } + + @TestMetadata("stepToSameLastThenStepOne.kt") + public void testStepToSameLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepToSameLastThenStepOne.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSameLast.kt") + public void testStepToSameLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepToSameLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSmallerLast.kt") + public void testStepToSameLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepToSameLastThenStepToSmallerLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepOne.kt") + public void testStepToSmallerLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepToSmallerLastThenStepOne.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSameLast.kt") + public void testStepToSmallerLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepToSmallerLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSmallerLast.kt") + public void testStepToSmallerLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/nestedStep/stepToSmallerLastThenStepToSmallerLast.kt"); + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/reversed") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Reversed extends AbstractJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); + } + + public void testAllFilesPresentInReversed() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/reversed"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); + } + + @TestMetadata("reversedThenStep.kt") + public void testReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/reversed/reversedThenStep.kt"); + } + + @TestMetadata("reversedThenStepThenReversed.kt") + public void testReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/reversed/reversedThenStepThenReversed.kt"); + } + + @TestMetadata("reversedThenStepThenReversedThenStep.kt") + public void testReversedThenStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/reversed/reversedThenStepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversed.kt") + public void testStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/reversed/stepThenReversed.kt"); + } + + @TestMetadata("stepThenReversedThenStep.kt") + public void testStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/reversed/stepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversedThenStepThenReversed.kt") + public void testStepThenReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/rangeTo/reversed/stepThenReversedThenStepThenReversed.kt"); + } + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/expression/until") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Until extends AbstractJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); + } + + public void testAllFilesPresentInUntil() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/expression/until"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); + } + + @TestMetadata("emptyProgression.kt") + public void testEmptyProgression() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/emptyProgression.kt"); + } + + @TestMetadata("emptyProgressionToMinValue.kt") + public void testEmptyProgressionToMinValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/emptyProgressionToMinValue.kt"); + } + + @TestMetadata("illegalStepNegative.kt") + public void testIllegalStepNegative() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/illegalStepNegative.kt"); + } + + @TestMetadata("illegalStepNonConst.kt") + public void testIllegalStepNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/illegalStepNonConst.kt"); + } + + @TestMetadata("illegalStepThenLegalStep.kt") + public void testIllegalStepThenLegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/illegalStepThenLegalStep.kt"); + } + + @TestMetadata("illegalStepZero.kt") + public void testIllegalStepZero() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/illegalStepZero.kt"); + } + + @TestMetadata("legalStepThenIllegalStep.kt") + public void testLegalStepThenIllegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/legalStepThenIllegalStep.kt"); + } + + @TestMetadata("minValueToMaxValueStepMaxValue.kt") + public void testMinValueToMaxValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/minValueToMaxValueStepMaxValue.kt"); + } + + @TestMetadata("mixedTypeStep.kt") + public void testMixedTypeStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/mixedTypeStep.kt"); + } + + @TestMetadata("singleElementStepTwo.kt") + public void testSingleElementStepTwo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/singleElementStepTwo.kt"); + } + + @TestMetadata("stepNonConst.kt") + public void testStepNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/stepNonConst.kt"); + } + + @TestMetadata("stepOne.kt") + public void testStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/stepOne.kt"); + } + + @TestMetadata("stepToOutsideRange.kt") + public void testStepToOutsideRange() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/stepToOutsideRange.kt"); + } + + @TestMetadata("stepToSameLast.kt") + public void testStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/stepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLast.kt") + public void testStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/stepToSmallerLast.kt"); + } + + @TestMetadata("zeroToMaxValueStepMaxValue.kt") + public void testZeroToMaxValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/zeroToMaxValueStepMaxValue.kt"); + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class NestedStep extends AbstractJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); + } + + public void testAllFilesPresentInNestedStep() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); + } + + @TestMetadata("stepOneThenStepOne.kt") + public void testStepOneThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepOneThenStepOne.kt"); + } + + @TestMetadata("stepThenSameStep.kt") + public void testStepThenSameStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepThenSameStep.kt"); + } + + @TestMetadata("stepToSameLastThenStepOne.kt") + public void testStepToSameLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepToSameLastThenStepOne.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSameLast.kt") + public void testStepToSameLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepToSameLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSmallerLast.kt") + public void testStepToSameLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepToSameLastThenStepToSmallerLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepOne.kt") + public void testStepToSmallerLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepToSmallerLastThenStepOne.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSameLast.kt") + public void testStepToSmallerLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepToSmallerLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSmallerLast.kt") + public void testStepToSmallerLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/nestedStep/stepToSmallerLastThenStepToSmallerLast.kt"); + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/expression/until/reversed") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Reversed extends AbstractJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); + } + + public void testAllFilesPresentInReversed() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/expression/until/reversed"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); + } + + @TestMetadata("reversedThenStep.kt") + public void testReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/reversed/reversedThenStep.kt"); + } + + @TestMetadata("reversedThenStepThenReversed.kt") + public void testReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/reversed/reversedThenStepThenReversed.kt"); + } + + @TestMetadata("reversedThenStepThenReversedThenStep.kt") + public void testReversedThenStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/reversed/reversedThenStepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversed.kt") + public void testStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/reversed/stepThenReversed.kt"); + } + + @TestMetadata("stepThenReversedThenStep.kt") + public void testStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/reversed/stepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversedThenStepThenReversed.kt") + public void testStepThenReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/expression/until/reversed/stepThenReversedThenStepThenReversed.kt"); + } + } + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/literal") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Literal extends AbstractJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); + } + + public void testAllFilesPresentInLiteral() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/literal"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/literal/downTo") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class DownTo extends AbstractJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); + } + + public void testAllFilesPresentInDownTo() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/literal/downTo"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); + } + + @TestMetadata("emptyProgression.kt") + public void testEmptyProgression() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/emptyProgression.kt"); + } + + @TestMetadata("illegalStepThenLegalStep.kt") + public void testIllegalStepThenLegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/illegalStepThenLegalStep.kt"); + } + + @TestMetadata("legalStepThenIllegalStep.kt") + public void testLegalStepThenIllegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/legalStepThenIllegalStep.kt"); + } + + @TestMetadata("maxValueToMinValueStepMaxValue.kt") + public void testMaxValueToMinValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/maxValueToMinValueStepMaxValue.kt"); + } + + @TestMetadata("maxValueToOneStepMaxValue.kt") + public void testMaxValueToOneStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/maxValueToOneStepMaxValue.kt"); + } + + @TestMetadata("maxValueToZeroStepMaxValue.kt") + public void testMaxValueToZeroStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/maxValueToZeroStepMaxValue.kt"); + } + + @TestMetadata("mixedTypeStep.kt") + public void testMixedTypeStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/mixedTypeStep.kt"); + } + + @TestMetadata("singleElementStepTwo.kt") + public void testSingleElementStepTwo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/singleElementStepTwo.kt"); + } + + @TestMetadata("stepNonConst.kt") + public void testStepNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/stepNonConst.kt"); + } + + @TestMetadata("stepOne.kt") + public void testStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/stepOne.kt"); + } + + @TestMetadata("stepToOutsideRange.kt") + public void testStepToOutsideRange() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/stepToOutsideRange.kt"); + } + + @TestMetadata("stepToSameLast.kt") + public void testStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/stepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLast.kt") + public void testStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/stepToSmallerLast.kt"); + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class NestedStep extends AbstractJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); + } + + public void testAllFilesPresentInNestedStep() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); + } + + @TestMetadata("stepOneThenStepOne.kt") + public void testStepOneThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepOneThenStepOne.kt"); + } + + @TestMetadata("stepThenSameStep.kt") + public void testStepThenSameStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepThenSameStep.kt"); + } + + @TestMetadata("stepToSameLastThenStepOne.kt") + public void testStepToSameLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepToSameLastThenStepOne.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSameLast.kt") + public void testStepToSameLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepToSameLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSmallerLast.kt") + public void testStepToSameLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepToSameLastThenStepToSmallerLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepOne.kt") + public void testStepToSmallerLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepToSmallerLastThenStepOne.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSameLast.kt") + public void testStepToSmallerLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepToSmallerLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSmallerLast.kt") + public void testStepToSmallerLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/nestedStep/stepToSmallerLastThenStepToSmallerLast.kt"); + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/literal/downTo/reversed") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Reversed extends AbstractJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); + } + + public void testAllFilesPresentInReversed() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/literal/downTo/reversed"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); + } + + @TestMetadata("reversedThenStep.kt") + public void testReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/reversed/reversedThenStep.kt"); + } + + @TestMetadata("reversedThenStepThenReversed.kt") + public void testReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/reversed/reversedThenStepThenReversed.kt"); + } + + @TestMetadata("reversedThenStepThenReversedThenStep.kt") + public void testReversedThenStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/reversed/reversedThenStepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversed.kt") + public void testStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/reversed/stepThenReversed.kt"); + } + + @TestMetadata("stepThenReversedThenStep.kt") + public void testStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/reversed/stepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversedThenStepThenReversed.kt") + public void testStepThenReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/downTo/reversed/stepThenReversedThenStepThenReversed.kt"); + } + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class RangeTo extends AbstractJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); + } + + public void testAllFilesPresentInRangeTo() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); + } + + @TestMetadata("emptyProgression.kt") + public void testEmptyProgression() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/emptyProgression.kt"); + } + + @TestMetadata("illegalStepThenLegalStep.kt") + public void testIllegalStepThenLegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/illegalStepThenLegalStep.kt"); + } + + @TestMetadata("legalStepThenIllegalStep.kt") + public void testLegalStepThenIllegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/legalStepThenIllegalStep.kt"); + } + + @TestMetadata("minValueToMaxValueStepMaxValue.kt") + public void testMinValueToMaxValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/minValueToMaxValueStepMaxValue.kt"); + } + + @TestMetadata("mixedTypeStep.kt") + public void testMixedTypeStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/mixedTypeStep.kt"); + } + + @TestMetadata("oneToMaxValueStepMaxValue.kt") + public void testOneToMaxValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/oneToMaxValueStepMaxValue.kt"); + } + + @TestMetadata("singleElementStepTwo.kt") + public void testSingleElementStepTwo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/singleElementStepTwo.kt"); + } + + @TestMetadata("stepNonConst.kt") + public void testStepNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/stepNonConst.kt"); + } + + @TestMetadata("stepOne.kt") + public void testStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/stepOne.kt"); + } + + @TestMetadata("stepToOutsideRange.kt") + public void testStepToOutsideRange() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/stepToOutsideRange.kt"); + } + + @TestMetadata("stepToSameLast.kt") + public void testStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/stepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLast.kt") + public void testStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/stepToSmallerLast.kt"); + } + + @TestMetadata("zeroToMaxValueStepMaxValue.kt") + public void testZeroToMaxValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/zeroToMaxValueStepMaxValue.kt"); + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class NestedStep extends AbstractJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); + } + + public void testAllFilesPresentInNestedStep() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); + } + + @TestMetadata("stepOneThenStepOne.kt") + public void testStepOneThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepOneThenStepOne.kt"); + } + + @TestMetadata("stepThenSameStep.kt") + public void testStepThenSameStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepThenSameStep.kt"); + } + + @TestMetadata("stepToSameLastThenStepOne.kt") + public void testStepToSameLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepToSameLastThenStepOne.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSameLast.kt") + public void testStepToSameLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepToSameLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSmallerLast.kt") + public void testStepToSameLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepToSameLastThenStepToSmallerLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepOne.kt") + public void testStepToSmallerLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepToSmallerLastThenStepOne.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSameLast.kt") + public void testStepToSmallerLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepToSmallerLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSmallerLast.kt") + public void testStepToSmallerLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/nestedStep/stepToSmallerLastThenStepToSmallerLast.kt"); + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/reversed") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Reversed extends AbstractJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); + } + + public void testAllFilesPresentInReversed() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/reversed"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); + } + + @TestMetadata("reversedThenStep.kt") + public void testReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/reversed/reversedThenStep.kt"); + } + + @TestMetadata("reversedThenStepThenReversed.kt") + public void testReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/reversed/reversedThenStepThenReversed.kt"); + } + + @TestMetadata("reversedThenStepThenReversedThenStep.kt") + public void testReversedThenStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/reversed/reversedThenStepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversed.kt") + public void testStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/reversed/stepThenReversed.kt"); + } + + @TestMetadata("stepThenReversedThenStep.kt") + public void testStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/reversed/stepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversedThenStepThenReversed.kt") + public void testStepThenReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/rangeTo/reversed/stepThenReversedThenStepThenReversed.kt"); + } + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/literal/until") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Until extends AbstractJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); + } + + public void testAllFilesPresentInUntil() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/literal/until"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); + } + + @TestMetadata("emptyProgression.kt") + public void testEmptyProgression() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/emptyProgression.kt"); + } + + @TestMetadata("emptyProgressionToMinValue.kt") + public void testEmptyProgressionToMinValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/emptyProgressionToMinValue.kt"); + } + + @TestMetadata("illegalStepThenLegalStep.kt") + public void testIllegalStepThenLegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/illegalStepThenLegalStep.kt"); + } + + @TestMetadata("legalStepThenIllegalStep.kt") + public void testLegalStepThenIllegalStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/legalStepThenIllegalStep.kt"); + } + + @TestMetadata("minValueToMaxValueStepMaxValue.kt") + public void testMinValueToMaxValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/minValueToMaxValueStepMaxValue.kt"); + } + + @TestMetadata("mixedTypeStep.kt") + public void testMixedTypeStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/mixedTypeStep.kt"); + } + + @TestMetadata("progressionToNonConst.kt") + public void testProgressionToNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/progressionToNonConst.kt"); + } + + @TestMetadata("singleElementStepTwo.kt") + public void testSingleElementStepTwo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/singleElementStepTwo.kt"); + } + + @TestMetadata("stepNonConst.kt") + public void testStepNonConst() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/stepNonConst.kt"); + } + + @TestMetadata("stepOne.kt") + public void testStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/stepOne.kt"); + } + + @TestMetadata("stepToOutsideRange.kt") + public void testStepToOutsideRange() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/stepToOutsideRange.kt"); + } + + @TestMetadata("stepToSameLast.kt") + public void testStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/stepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLast.kt") + public void testStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/stepToSmallerLast.kt"); + } + + @TestMetadata("zeroToMaxValueStepMaxValue.kt") + public void testZeroToMaxValueStepMaxValue() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/zeroToMaxValueStepMaxValue.kt"); + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class NestedStep extends AbstractJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); + } + + public void testAllFilesPresentInNestedStep() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); + } + + @TestMetadata("stepOneThenStepOne.kt") + public void testStepOneThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepOneThenStepOne.kt"); + } + + @TestMetadata("stepThenSameStep.kt") + public void testStepThenSameStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepThenSameStep.kt"); + } + + @TestMetadata("stepToSameLastThenStepOne.kt") + public void testStepToSameLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepToSameLastThenStepOne.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSameLast.kt") + public void testStepToSameLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepToSameLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSameLastThenStepToSmallerLast.kt") + public void testStepToSameLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepToSameLastThenStepToSmallerLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepOne.kt") + public void testStepToSmallerLastThenStepOne() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepToSmallerLastThenStepOne.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSameLast.kt") + public void testStepToSmallerLastThenStepToSameLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepToSmallerLastThenStepToSameLast.kt"); + } + + @TestMetadata("stepToSmallerLastThenStepToSmallerLast.kt") + public void testStepToSmallerLastThenStepToSmallerLast() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/nestedStep/stepToSmallerLastThenStepToSmallerLast.kt"); + } + } + + @TestMetadata("compiler/testData/codegen/box/ranges/stepped/literal/until/reversed") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Reversed extends AbstractJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); + } + + public void testAllFilesPresentInReversed() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/stepped/literal/until/reversed"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); + } + + @TestMetadata("reversedThenStep.kt") + public void testReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/reversed/reversedThenStep.kt"); + } + + @TestMetadata("reversedThenStepThenReversed.kt") + public void testReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/reversed/reversedThenStepThenReversed.kt"); + } + + @TestMetadata("reversedThenStepThenReversedThenStep.kt") + public void testReversedThenStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/reversed/reversedThenStepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversed.kt") + public void testStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/reversed/stepThenReversed.kt"); + } + + @TestMetadata("stepThenReversedThenStep.kt") + public void testStepThenReversedThenStep() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/reversed/stepThenReversedThenStep.kt"); + } + + @TestMetadata("stepThenReversedThenStepThenReversed.kt") + public void testStepThenReversedThenStepThenReversed() throws Exception { + runTest("compiler/testData/codegen/box/ranges/stepped/literal/until/reversed/stepThenReversedThenStepThenReversed.kt"); + } + } + } + } + } + @TestMetadata("compiler/testData/codegen/box/ranges/unsigned") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class)