Support trailing comma

^KT-34743 Fixed
This commit is contained in:
victor.petukhov
2019-10-07 13:21:25 +03:00
parent e638b9fd12
commit 62d204f4d6
83 changed files with 4717 additions and 96 deletions
@@ -3392,6 +3392,84 @@ public class DiagnosticsTestWithStdLibGenerated extends AbstractDiagnosticsTestW
}
}
@TestMetadata("compiler/testData/diagnostics/testsWithStdLib/trailingComma")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class TrailingComma extends AbstractDiagnosticsTestWithStdLib {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInTrailingComma() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/testsWithStdLib/trailingComma"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("multiVariableDeclarationWithDisabledFeature.kt")
public void testMultiVariableDeclarationWithDisabledFeature() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/trailingComma/multiVariableDeclarationWithDisabledFeature.kt");
}
@TestMetadata("multiVariableDeclarationWithEnabledFeature.kt")
public void testMultiVariableDeclarationWithEnabledFeature() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/trailingComma/multiVariableDeclarationWithEnabledFeature.kt");
}
@TestMetadata("noDisambiguation.kt")
public void testNoDisambiguation() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/trailingComma/noDisambiguation.kt");
}
@TestMetadata("typeArgumentsWithDisabledFeature.kt")
public void testTypeArgumentsWithDisabledFeature() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/trailingComma/typeArgumentsWithDisabledFeature.kt");
}
@TestMetadata("typeArgumentsWithEnabledFeature.kt")
public void testTypeArgumentsWithEnabledFeature() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/trailingComma/typeArgumentsWithEnabledFeature.kt");
}
@TestMetadata("typeParametersWithDisabledFeature.kt")
public void testTypeParametersWithDisabledFeature() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/trailingComma/typeParametersWithDisabledFeature.kt");
}
@TestMetadata("typeParametersWithEnabledFeature.kt")
public void testTypeParametersWithEnabledFeature() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/trailingComma/typeParametersWithEnabledFeature.kt");
}
@TestMetadata("valueArgumentsWithDisabledFeature.kt")
public void testValueArgumentsWithDisabledFeature() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/trailingComma/valueArgumentsWithDisabledFeature.kt");
}
@TestMetadata("valueArgumentsWithEnabledFeature.kt")
public void testValueArgumentsWithEnabledFeature() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/trailingComma/valueArgumentsWithEnabledFeature.kt");
}
@TestMetadata("valueParametersWithDisabledFeature.kt")
public void testValueParametersWithDisabledFeature() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/trailingComma/valueParametersWithDisabledFeature.kt");
}
@TestMetadata("valueParametersWithEnabledFeature.kt")
public void testValueParametersWithEnabledFeature() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/trailingComma/valueParametersWithEnabledFeature.kt");
}
@TestMetadata("whenEntryWithDisabledFeature.kt")
public void testWhenEntryWithDisabledFeature() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/trailingComma/whenEntryWithDisabledFeature.kt");
}
@TestMetadata("whenEntryWithEnabledFeature.kt")
public void testWhenEntryWithEnabledFeature() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/trailingComma/whenEntryWithEnabledFeature.kt");
}
}
@TestMetadata("compiler/testData/diagnostics/testsWithStdLib/tryCatch")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -3392,6 +3392,84 @@ public class DiagnosticsTestWithStdLibUsingJavacGenerated extends AbstractDiagno
}
}
@TestMetadata("compiler/testData/diagnostics/testsWithStdLib/trailingComma")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class TrailingComma extends AbstractDiagnosticsTestWithStdLibUsingJavac {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInTrailingComma() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/testsWithStdLib/trailingComma"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("multiVariableDeclarationWithDisabledFeature.kt")
public void testMultiVariableDeclarationWithDisabledFeature() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/trailingComma/multiVariableDeclarationWithDisabledFeature.kt");
}
@TestMetadata("multiVariableDeclarationWithEnabledFeature.kt")
public void testMultiVariableDeclarationWithEnabledFeature() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/trailingComma/multiVariableDeclarationWithEnabledFeature.kt");
}
@TestMetadata("noDisambiguation.kt")
public void testNoDisambiguation() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/trailingComma/noDisambiguation.kt");
}
@TestMetadata("typeArgumentsWithDisabledFeature.kt")
public void testTypeArgumentsWithDisabledFeature() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/trailingComma/typeArgumentsWithDisabledFeature.kt");
}
@TestMetadata("typeArgumentsWithEnabledFeature.kt")
public void testTypeArgumentsWithEnabledFeature() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/trailingComma/typeArgumentsWithEnabledFeature.kt");
}
@TestMetadata("typeParametersWithDisabledFeature.kt")
public void testTypeParametersWithDisabledFeature() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/trailingComma/typeParametersWithDisabledFeature.kt");
}
@TestMetadata("typeParametersWithEnabledFeature.kt")
public void testTypeParametersWithEnabledFeature() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/trailingComma/typeParametersWithEnabledFeature.kt");
}
@TestMetadata("valueArgumentsWithDisabledFeature.kt")
public void testValueArgumentsWithDisabledFeature() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/trailingComma/valueArgumentsWithDisabledFeature.kt");
}
@TestMetadata("valueArgumentsWithEnabledFeature.kt")
public void testValueArgumentsWithEnabledFeature() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/trailingComma/valueArgumentsWithEnabledFeature.kt");
}
@TestMetadata("valueParametersWithDisabledFeature.kt")
public void testValueParametersWithDisabledFeature() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/trailingComma/valueParametersWithDisabledFeature.kt");
}
@TestMetadata("valueParametersWithEnabledFeature.kt")
public void testValueParametersWithEnabledFeature() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/trailingComma/valueParametersWithEnabledFeature.kt");
}
@TestMetadata("whenEntryWithDisabledFeature.kt")
public void testWhenEntryWithDisabledFeature() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/trailingComma/whenEntryWithDisabledFeature.kt");
}
@TestMetadata("whenEntryWithEnabledFeature.kt")
public void testWhenEntryWithEnabledFeature() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/trailingComma/whenEntryWithEnabledFeature.kt");
}
}
@TestMetadata("compiler/testData/diagnostics/testsWithStdLib/tryCatch")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -26580,6 +26580,24 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
}
}
@TestMetadata("compiler/testData/codegen/box/trailingComma")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class TrailingComma extends AbstractBlackBoxCodegenTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
}
public void testAllFilesPresentInTrailingComma() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/trailingComma"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true);
}
@TestMetadata("noDisambiguation.kt")
public void testNoDisambiguation() throws Exception {
runTest("compiler/testData/codegen/box/trailingComma/noDisambiguation.kt");
}
}
@TestMetadata("compiler/testData/codegen/box/traits")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -25397,6 +25397,24 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
}
}
@TestMetadata("compiler/testData/codegen/box/trailingComma")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class TrailingComma extends AbstractLightAnalysisModeTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
}
public void testAllFilesPresentInTrailingComma() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/trailingComma"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true);
}
@TestMetadata("noDisambiguation.kt")
public void testNoDisambiguation() throws Exception {
runTest("compiler/testData/codegen/box/trailingComma/noDisambiguation.kt");
}
}
@TestMetadata("compiler/testData/codegen/box/traits")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -25414,6 +25414,24 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
}
}
@TestMetadata("compiler/testData/codegen/box/trailingComma")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class TrailingComma extends AbstractIrBlackBoxCodegenTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath);
}
public void testAllFilesPresentInTrailingComma() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/trailingComma"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true);
}
@TestMetadata("noDisambiguation.kt")
public void testNoDisambiguation() throws Exception {
runTest("compiler/testData/codegen/box/trailingComma/noDisambiguation.kt");
}
}
@TestMetadata("compiler/testData/codegen/box/traits")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -380,11 +380,6 @@ public class ParsingTestGenerated extends AbstractParsingTest {
runTest("compiler/testData/psi/FunctionTypes.kt");
}
@TestMetadata("FunctionTypes_ERR.kt")
public void testFunctionTypes_ERR() throws Exception {
runTest("compiler/testData/psi/FunctionTypes_ERR.kt");
}
@TestMetadata("Functions.kt")
public void testFunctions() throws Exception {
runTest("compiler/testData/psi/Functions.kt");
@@ -645,6 +640,16 @@ public class ParsingTestGenerated extends AbstractParsingTest {
runTest("compiler/testData/psi/Super.kt");
}
@TestMetadata("trailingCommaAllowed.kt")
public void testTrailingCommaAllowed() throws Exception {
runTest("compiler/testData/psi/trailingCommaAllowed.kt");
}
@TestMetadata("trailingCommaForbidden.kt")
public void testTrailingCommaForbidden() throws Exception {
runTest("compiler/testData/psi/trailingCommaForbidden.kt");
}
@TestMetadata("TraitConstructor.kt")
public void testTraitConstructor() throws Exception {
runTest("compiler/testData/psi/TraitConstructor.kt");