Unwrap: function parameter (KT-14788)

#KT-14788 Fixed
This commit is contained in:
Toshiaki Kameyama
2018-03-12 10:07:07 +09:00
committed by Nikolay Krasko
parent 6838873a93
commit c1f43558b9
9 changed files with 102 additions and 0 deletions
@@ -75,6 +75,10 @@ public abstract class AbstractUnwrapRemoveTest extends LightCodeInsightTestCase
doTest(path, KotlinLambdaUnwrapper.class);
}
public void doTestFunctionParameterUnwrapper(@NotNull String path) throws Exception {
doTest(path, KotlinFunctionParameterUnwrapper.class);
}
private void doTest(@NotNull String path, final Class<? extends Unwrapper> unwrapperClass) throws Exception {
configureByFile(path);
@@ -339,4 +339,31 @@ public class UnwrapRemoveTestGenerated extends AbstractUnwrapRemoveTest {
doTestLambdaUnwrapper(fileName);
}
}
@TestMetadata("idea/testData/codeInsight/unwrapAndRemove/unwrapFunctionParameter")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class UnwrapFunctionParameter extends AbstractUnwrapRemoveTest {
public void testAllFilesPresentInUnwrapFunctionParameter() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/codeInsight/unwrapAndRemove/unwrapFunctionParameter"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true);
}
@TestMetadata("functionHasMultiParam.kt")
public void testFunctionHasMultiParam() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/codeInsight/unwrapAndRemove/unwrapFunctionParameter/functionHasMultiParam.kt");
doTestFunctionParameterUnwrapper(fileName);
}
@TestMetadata("functionHasSingleParam.kt")
public void testFunctionHasSingleParam() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/codeInsight/unwrapAndRemove/unwrapFunctionParameter/functionHasSingleParam.kt");
doTestFunctionParameterUnwrapper(fileName);
}
@TestMetadata("functionWithReceiver.kt")
public void testFunctionWithReceiver() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/codeInsight/unwrapAndRemove/unwrapFunctionParameter/functionWithReceiver.kt");
doTestFunctionParameterUnwrapper(fileName);
}
}
}