Introduce "Redundant 'asSequence' call" inspections

#KT-35893 Fixed
This commit is contained in:
Toshiaki Kameyama
2020-01-14 17:54:21 +09:00
committed by igoriakovlev
parent e2c3455445
commit afd544cbab
18 changed files with 183 additions and 5 deletions
@@ -1479,6 +1479,49 @@ public class LocalInspectionTestGenerated extends AbstractLocalInspectionTest {
}
}
@TestMetadata("idea/testData/inspectionsLocal/collections/redundantAsSequence")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class RedundantAsSequence extends AbstractLocalInspectionTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInRedundantAsSequence() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("idea/testData/inspectionsLocal/collections/redundantAsSequence"), Pattern.compile("^([\\w\\-_]+)\\.(kt|kts)$"), null, true);
}
@TestMetadata("hasComment.kt")
public void testHasComment() throws Exception {
runTest("idea/testData/inspectionsLocal/collections/redundantAsSequence/hasComment.kt");
}
@TestMetadata("hasLineBreak.kt")
public void testHasLineBreak() throws Exception {
runTest("idea/testData/inspectionsLocal/collections/redundantAsSequence/hasLineBreak.kt");
}
@TestMetadata("notTermination.kt")
public void testNotTermination() throws Exception {
runTest("idea/testData/inspectionsLocal/collections/redundantAsSequence/notTermination.kt");
}
@TestMetadata("nullable.kt")
public void testNullable() throws Exception {
runTest("idea/testData/inspectionsLocal/collections/redundantAsSequence/nullable.kt");
}
@TestMetadata("simple.kt")
public void testSimple() throws Exception {
runTest("idea/testData/inspectionsLocal/collections/redundantAsSequence/simple.kt");
}
@TestMetadata("simple2.kt")
public void testSimple2() throws Exception {
runTest("idea/testData/inspectionsLocal/collections/redundantAsSequence/simple2.kt");
}
}
@TestMetadata("idea/testData/inspectionsLocal/collections/simplifiableCall")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)