Handle withIndex() on Iterables (including progressions) and Sequences

in ForLoopsLowering.
This commit is contained in:
Mark Punzalan
2019-11-05 11:15:33 -08:00
committed by max-kammerer
parent a54d9482dd
commit 7adffe0007
49 changed files with 1357 additions and 42 deletions
@@ -2007,6 +2007,79 @@ public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest {
}
}
@TestMetadata("compiler/testData/codegen/bytecodeText/forLoop/forInProgressionWithIndex")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class ForInProgressionWithIndex extends AbstractBytecodeTextTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
}
public void testAllFilesPresentInForInProgressionWithIndex() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/bytecodeText/forLoop/forInProgressionWithIndex"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true);
}
@TestMetadata("forInDownToWithIndex.kt")
public void testForInDownToWithIndex() throws Exception {
runTest("compiler/testData/codegen/bytecodeText/forLoop/forInProgressionWithIndex/forInDownToWithIndex.kt");
}
@TestMetadata("forInIndicesWithIndex.kt")
public void testForInIndicesWithIndex() throws Exception {
runTest("compiler/testData/codegen/bytecodeText/forLoop/forInProgressionWithIndex/forInIndicesWithIndex.kt");
}
@TestMetadata("forInRangeToWithIndex.kt")
public void testForInRangeToWithIndex() throws Exception {
runTest("compiler/testData/codegen/bytecodeText/forLoop/forInProgressionWithIndex/forInRangeToWithIndex.kt");
}
@TestMetadata("forInReversedStepWithIndex.kt")
public void testForInReversedStepWithIndex() throws Exception {
runTest("compiler/testData/codegen/bytecodeText/forLoop/forInProgressionWithIndex/forInReversedStepWithIndex.kt");
}
@TestMetadata("forInReversedWithIndex.kt")
public void testForInReversedWithIndex() throws Exception {
runTest("compiler/testData/codegen/bytecodeText/forLoop/forInProgressionWithIndex/forInReversedWithIndex.kt");
}
@TestMetadata("forInStepReversedWithIndex.kt")
public void testForInStepReversedWithIndex() throws Exception {
runTest("compiler/testData/codegen/bytecodeText/forLoop/forInProgressionWithIndex/forInStepReversedWithIndex.kt");
}
@TestMetadata("forInStepWithIndex.kt")
public void testForInStepWithIndex() throws Exception {
runTest("compiler/testData/codegen/bytecodeText/forLoop/forInProgressionWithIndex/forInStepWithIndex.kt");
}
@TestMetadata("forInUntilWithIndex.kt")
public void testForInUntilWithIndex() throws Exception {
runTest("compiler/testData/codegen/bytecodeText/forLoop/forInProgressionWithIndex/forInUntilWithIndex.kt");
}
@TestMetadata("forInWithIndexNoIndexOrElementVar.kt")
public void testForInWithIndexNoIndexOrElementVar() throws Exception {
runTest("compiler/testData/codegen/bytecodeText/forLoop/forInProgressionWithIndex/forInWithIndexNoIndexOrElementVar.kt");
}
@TestMetadata("forInWithIndexNotDestructured.kt")
public void testForInWithIndexNotDestructured() throws Exception {
runTest("compiler/testData/codegen/bytecodeText/forLoop/forInProgressionWithIndex/forInWithIndexNotDestructured.kt");
}
@TestMetadata("forInWithIndexReversed.kt")
public void testForInWithIndexReversed() throws Exception {
runTest("compiler/testData/codegen/bytecodeText/forLoop/forInProgressionWithIndex/forInWithIndexReversed.kt");
}
@TestMetadata("forInWithIndexWithIndex.kt")
public void testForInWithIndexWithIndex() throws Exception {
runTest("compiler/testData/codegen/bytecodeText/forLoop/forInProgressionWithIndex/forInWithIndexWithIndex.kt");
}
}
@TestMetadata("compiler/testData/codegen/bytecodeText/forLoop/forInReversed")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)