Convert intention "a..b-1 -> a until b" into weak warning inspection

So #KT-17895 Fixed
This commit is contained in:
Ilya Zorin
2017-05-25 18:25:11 +03:00
committed by Mikhail Glukhikh
parent 0fd42bc747
commit 5e265b3d17
26 changed files with 242 additions and 157 deletions
@@ -299,6 +299,12 @@ public class InspectionTestGenerated extends AbstractInspectionTest {
doTest(fileName);
}
@TestMetadata("replaceRangeToWithUntil/inspectionData/inspections.test")
public void testReplaceRangeToWithUntil_inspectionData_Inspections_test() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/inspections/replaceRangeToWithUntil/inspectionData/inspections.test");
doTest(fileName);
}
@TestMetadata("spelling/inspectionData/inspections.test")
public void testSpelling_inspectionData_Inspections_test() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/inspections/spelling/inspectionData/inspections.test");
@@ -209,4 +209,55 @@ public class LocalInspectionTestGenerated extends AbstractLocalInspectionTest {
doTest(fileName);
}
}
@TestMetadata("idea/testData/inspectionsLocal/replaceRangeToWithUntil")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class ReplaceRangeToWithUntil extends AbstractLocalInspectionTest {
public void testAllFilesPresentInReplaceRangeToWithUntil() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/inspectionsLocal/replaceRangeToWithUntil"), Pattern.compile("^([\\w\\-_]+)\\.kt$"), TargetBackend.ANY, true);
}
@TestMetadata("closedRange.kt")
public void testClosedRange() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/inspectionsLocal/replaceRangeToWithUntil/closedRange.kt");
doTest(fileName);
}
@TestMetadata("minusTwo.kt")
public void testMinusTwo() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/inspectionsLocal/replaceRangeToWithUntil/minusTwo.kt");
doTest(fileName);
}
@TestMetadata("notMinusOne.kt")
public void testNotMinusOne() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/inspectionsLocal/replaceRangeToWithUntil/notMinusOne.kt");
doTest(fileName);
}
@TestMetadata("operator.kt")
public void testOperator() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/inspectionsLocal/replaceRangeToWithUntil/operator.kt");
doTest(fileName);
}
@TestMetadata("operatorLong.kt")
public void testOperatorLong() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/inspectionsLocal/replaceRangeToWithUntil/operatorLong.kt");
doTest(fileName);
}
@TestMetadata("plusOne.kt")
public void testPlusOne() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/inspectionsLocal/replaceRangeToWithUntil/plusOne.kt");
doTest(fileName);
}
@TestMetadata("rangeTo.kt")
public void testRangeTo() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/inspectionsLocal/replaceRangeToWithUntil/rangeTo.kt");
doTest(fileName);
}
}
}
@@ -13512,57 +13512,6 @@ public class IntentionTestGenerated extends AbstractIntentionTest {
}
}
@TestMetadata("idea/testData/intentions/replaceRangeToWithUntil")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class ReplaceRangeToWithUntil extends AbstractIntentionTest {
public void testAllFilesPresentInReplaceRangeToWithUntil() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/intentions/replaceRangeToWithUntil"), Pattern.compile("^([\\w\\-_]+)\\.kt$"), TargetBackend.ANY, true);
}
@TestMetadata("closedRange.kt")
public void testClosedRange() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/replaceRangeToWithUntil/closedRange.kt");
doTest(fileName);
}
@TestMetadata("minusTwo.kt")
public void testMinusTwo() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/replaceRangeToWithUntil/minusTwo.kt");
doTest(fileName);
}
@TestMetadata("notMinusOne.kt")
public void testNotMinusOne() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/replaceRangeToWithUntil/notMinusOne.kt");
doTest(fileName);
}
@TestMetadata("operator.kt")
public void testOperator() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/replaceRangeToWithUntil/operator.kt");
doTest(fileName);
}
@TestMetadata("operatorLong.kt")
public void testOperatorLong() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/replaceRangeToWithUntil/operatorLong.kt");
doTest(fileName);
}
@TestMetadata("plusOne.kt")
public void testPlusOne() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/replaceRangeToWithUntil/plusOne.kt");
doTest(fileName);
}
@TestMetadata("rangeTo.kt")
public void testRangeTo() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/replaceRangeToWithUntil/rangeTo.kt");
doTest(fileName);
}
}
@TestMetadata("idea/testData/intentions/replaceSingleLineLetIntention")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)