Add quickfix tests for HasPlatformTypeInspection
(cherry picked from commit af1b26b)
This commit is contained in:
@@ -0,0 +1 @@
|
|||||||
|
org.jetbrains.kotlin.idea.inspections.HasPlatformTypeInspection
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
// "Add non-null asserted (!!) call" "false"
|
||||||
|
// ACTION: Convert function to property
|
||||||
|
// ACTION: Convert to block body
|
||||||
|
// ACTION: Create test
|
||||||
|
// ACTION: Specify return type explicitly
|
||||||
|
// ACTION: Specify return type explicitly
|
||||||
|
|
||||||
|
fun foo<caret>() = arrayOf(java.lang.String.valueOf(1))
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
// "Specify return type explicitly" "true"
|
||||||
|
|
||||||
|
fun foo<caret>() = arrayOf(java.lang.String.valueOf(1))
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
// "Specify return type explicitly" "true"
|
||||||
|
|
||||||
|
fun foo(): Array<String><caret> = arrayOf(java.lang.String.valueOf(1))
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
// "Add non-null asserted (!!) call" "true"
|
||||||
|
|
||||||
|
fun bar<caret>() = java.lang.String.valueOf(1)
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
// "Add non-null asserted (!!) call" "true"
|
||||||
|
|
||||||
|
fun bar<caret>() = java.lang.String.valueOf(1)!!
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
// "Specify return type explicitly" "true"
|
||||||
|
|
||||||
|
fun foo<caret>() = java.lang.String.valueOf(1)
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
// "Specify return type explicitly" "true"
|
||||||
|
|
||||||
|
fun foo(): String?<caret> = java.lang.String.valueOf(1)
|
||||||
@@ -6371,6 +6371,39 @@ public class QuickFixTestGenerated extends AbstractQuickFixTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("idea/testData/quickfix/platformTypesInspection")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
|
public static class PlatformTypesInspection extends AbstractQuickFixTest {
|
||||||
|
public void testAllFilesPresentInPlatformTypesInspection() throws Exception {
|
||||||
|
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/quickfix/platformTypesInspection"), Pattern.compile("^([\\w\\-_]+)\\.kt$"), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("nestedNoAssertRuntime.kt")
|
||||||
|
public void testNestedNoAssertRuntime() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/quickfix/platformTypesInspection/nestedNoAssertRuntime.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("nestedRuntime.kt")
|
||||||
|
public void testNestedRuntime() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/quickfix/platformTypesInspection/nestedRuntime.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("nullableAssertRuntime.kt")
|
||||||
|
public void testNullableAssertRuntime() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/quickfix/platformTypesInspection/nullableAssertRuntime.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("nullableRuntime.kt")
|
||||||
|
public void testNullableRuntime() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/quickfix/platformTypesInspection/nullableRuntime.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("idea/testData/quickfix/properties")
|
@TestMetadata("idea/testData/quickfix/properties")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
|
|||||||
Reference in New Issue
Block a user