Quick Fixes: Add test for KT-6430 (Create parameter quick fix inserts platform types into Kotlin code)
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
// "Create parameter 's'" "true"
|
||||
// ERROR: Unresolved reference: s
|
||||
|
||||
fun foo(s: String?) = C(s)
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// "Create parameter 's'" "true"
|
||||
// ERROR: Unresolved reference: s
|
||||
|
||||
fun foo() = C(<caret>s)
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
class C {
|
||||
C(String s) {}
|
||||
}
|
||||
@@ -292,13 +292,28 @@ public class QuickFixMultiFileTestGenerated extends AbstractQuickFixMultiFileTes
|
||||
|
||||
@TestMetadata("idea/testData/quickfix/createFromUsage/createVariable")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@InnerTestClasses({})
|
||||
@InnerTestClasses({CreateVariable.Parameter.class})
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class CreateVariable extends AbstractQuickFixMultiFileTest {
|
||||
public void testAllFilesPresentInCreateVariable() throws Exception {
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/quickfix/createFromUsage/createVariable"), Pattern.compile("^(\\w+)\\.before\\.Main\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("idea/testData/quickfix/createFromUsage/createVariable/parameter")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Parameter extends AbstractQuickFixMultiFileTest {
|
||||
public void testAllFilesPresentInParameter() throws Exception {
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/quickfix/createFromUsage/createVariable/parameter"), Pattern.compile("^(\\w+)\\.before\\.Main\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("platformType.before.Main.kt")
|
||||
public void testPlatformType() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/createFromUsage/createVariable/parameter/platformType.before.Main.kt");
|
||||
doTestWithExtraFile(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user