Change Signature: Add test for KT-4013 "'Change signature' does not add necessary imports"
#KT-4013 Fixed
This commit is contained in:
@@ -0,0 +1,5 @@
|
|||||||
|
package b
|
||||||
|
|
||||||
|
import a.Bar
|
||||||
|
|
||||||
|
fun foo(bar: Bar) {}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
// "Add parameter to function 'foo'" "true"
|
||||||
|
// ERROR: Too many arguments for internal fun foo(): kotlin.Unit defined in b
|
||||||
|
package a
|
||||||
|
|
||||||
|
import b.foo
|
||||||
|
|
||||||
|
class Bar
|
||||||
|
|
||||||
|
fun test() {
|
||||||
|
foo(Bar())
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
// "Add parameter to function 'foo'" "true"
|
||||||
|
// ERROR: Too many arguments for internal fun foo(): kotlin.Unit defined in b
|
||||||
|
package a
|
||||||
|
|
||||||
|
import b.foo
|
||||||
|
|
||||||
|
class Bar
|
||||||
|
|
||||||
|
fun test() {
|
||||||
|
foo(<caret>Bar())
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
package b
|
||||||
|
|
||||||
|
fun foo() {}
|
||||||
@@ -253,6 +253,12 @@ public class QuickFixMultiFileTestGenerated extends AbstractQuickFixMultiFileTes
|
|||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
public static class ChangeSignature extends AbstractQuickFixMultiFileTest {
|
public static class ChangeSignature extends AbstractQuickFixMultiFileTest {
|
||||||
|
@TestMetadata("addParameterWithImport.before.Main.kt")
|
||||||
|
public void testAddParameterWithImport() throws Exception {
|
||||||
|
String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/changeSignature/addParameterWithImport.before.Main.kt");
|
||||||
|
doTestWithExtraFile(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
public void testAllFilesPresentInChangeSignature() throws Exception {
|
public void testAllFilesPresentInChangeSignature() throws Exception {
|
||||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/quickfix/changeSignature"), Pattern.compile("^(\\w+)\\.before\\.Main\\.kt$"), true);
|
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/quickfix/changeSignature"), Pattern.compile("^(\\w+)\\.before\\.Main\\.kt$"), true);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user