Unify script file extensions to "kts" so that IDEA, compiler and tests agree when to parse as SCRIPT.

Include kt* files into formatter test generation, to test scripting formatting
This commit is contained in:
Ilya Ryzhenkov
2014-03-19 11:14:03 +04:00
committed by Andrey Breslav
parent 4ba423ee16
commit 98c54f39bb
49 changed files with 58 additions and 52 deletions
@@ -36,7 +36,7 @@ public class JetFormatterTestGenerated extends AbstractJetFormatterTest {
@InnerTestClasses({Formatter.ModifierList.class})
public static class Formatter extends AbstractJetFormatterTest {
public void testAllFilesPresentInFormatter() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/formatter"), Pattern.compile("^([^\\.]+)\\.after.kt$"), true);
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/formatter"), Pattern.compile("^([^\\.]+)\\.after\\.kt.*$"), true);
}
@TestMetadata("BlockFor.after.kt")
@@ -219,6 +219,11 @@ public class JetFormatterTestGenerated extends AbstractJetFormatterTest {
doTest("idea/testData/formatter/SaveSpacesInDocComments.after.kt");
}
@TestMetadata("Script.after.kts")
public void testScript() throws Exception {
doTest("idea/testData/formatter/Script.after.kts");
}
@TestMetadata("SingleLineFunctionLiteral.after.kt")
public void testSingleLineFunctionLiteral() throws Exception {
doTest("idea/testData/formatter/SingleLineFunctionLiteral.after.kt");
@@ -297,7 +302,7 @@ public class JetFormatterTestGenerated extends AbstractJetFormatterTest {
@TestMetadata("idea/testData/formatter/modifierList")
public static class ModifierList extends AbstractJetFormatterTest {
public void testAllFilesPresentInModifierList() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/formatter/modifierList"), Pattern.compile("^([^\\.]+)\\.after.kt$"), true);
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/formatter/modifierList"), Pattern.compile("^([^\\.]+)\\.after\\.kt.*$"), true);
}
@TestMetadata("funAnnotationBeforeAnnotation.after.kt")
@@ -394,7 +399,7 @@ public class JetFormatterTestGenerated extends AbstractJetFormatterTest {
@InnerTestClasses({})
public static class FormatterInverted extends AbstractJetFormatterTest {
public void testAllFilesPresentInFormatterInverted() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/formatter"), Pattern.compile("^([^\\.]+)\\.after.inv.kt$"), true);
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/formatter"), Pattern.compile("^([^\\.]+)\\.after\\.inv\\.kt.*$"), true);
}
@TestMetadata("CatchFinallyOnNewLine.after.inv.kt")