Regenerate tests for JS reserved words when cases changed
This commit is contained in:
committed by
Dmitry Jemerov
parent
4ca434da54
commit
a1979b6eb4
+9
-3
@@ -261,13 +261,17 @@ class TestDataBuilder() {
|
||||
|
||||
val testDataDir = File(testDataDirPath)
|
||||
|
||||
val cases = suites.flatMap { suite -> suite.cases.map { case -> suite.name + " / " + case.name } }.sorted()
|
||||
|
||||
val shouldBeEscapedFile = File("$testDataDirPath/SHOULD_BE_ESCAPED.txt")
|
||||
val shouldNotBeEscapedFile = File("$testDataDirPath/SHOULD_NOT_BE_ESCAPED.txt")
|
||||
val casesFile = File("$testDataDirPath/CASES.txt")
|
||||
|
||||
val shouldBeEscapedFromFile = shouldBeEscapedFile.readLinesOrNull()?.drop(1)
|
||||
val shouldNotBeEscapedFromFile = shouldNotBeEscapedFile.readLinesOrNull()?.drop(1)
|
||||
val casesFromFile = casesFile.readLinesOrNull()?.drop(1)
|
||||
|
||||
val isCreatingFromScratch = shouldBeEscapedFromFile != SHOULD_BE_ESCAPED || shouldNotBeEscapedFromFile != SHOULD_NOT_BE_ESCAPED
|
||||
val isCreatingFromScratch = shouldBeEscapedFromFile != SHOULD_BE_ESCAPED || shouldNotBeEscapedFromFile != SHOULD_NOT_BE_ESCAPED || casesFromFile != cases
|
||||
|
||||
if (!testDataDir.exists() && !testDataDir.mkdirs()) {
|
||||
error("Unable to find or create test data directory: '$testDataDirPath'.")
|
||||
@@ -320,6 +324,8 @@ class TestDataBuilder() {
|
||||
if (isCreatingFromScratch) {
|
||||
shouldBeEscapedFile.writeText("$PREAMBLE_MESSAGE\n${SHOULD_BE_ESCAPED.join("\n")}")
|
||||
shouldNotBeEscapedFile.writeText("$PREAMBLE_MESSAGE\n${SHOULD_NOT_BE_ESCAPED.join("\n")}")
|
||||
casesFile.writeText("$PREAMBLE_MESSAGE\n${cases.join("\n")}")
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -353,8 +359,8 @@ val testNotRenamedByRef = testNotRenamed("::$KEYWORD_MARKER")
|
||||
|
||||
// KEYWORDS
|
||||
|
||||
val SHOULD_BE_ESCAPED = JsFunctionScope.RESERVED_WORDS.filter { it in KeywordStringsGenerated.KEYWORDS }.toSortedList()
|
||||
val SHOULD_NOT_BE_ESCAPED = JsFunctionScope.RESERVED_WORDS.filter { it !in SHOULD_BE_ESCAPED }.toSortedList()
|
||||
val SHOULD_BE_ESCAPED = JsFunctionScope.RESERVED_WORDS.filter { it in KeywordStringsGenerated.KEYWORDS }.sorted()
|
||||
val SHOULD_NOT_BE_ESCAPED = JsFunctionScope.RESERVED_WORDS.filter { it !in SHOULD_BE_ESCAPED }.sorted()
|
||||
|
||||
// all keywords by portions
|
||||
|
||||
|
||||
@@ -1158,7 +1158,6 @@ public class QuickFixMultiFileTestGenerated extends AbstractQuickFixMultiFileTes
|
||||
doTestWithExtraFile(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@TestMetadata("idea/testData/quickfix/modifiers")
|
||||
|
||||
@@ -4225,21 +4225,6 @@ public class QuickFixTestGenerated extends AbstractQuickFixTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("idea/testData/quickfix/migration/traitToInterface")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class TraitToInterface extends AbstractQuickFixTest {
|
||||
public void testAllFilesPresentInTraitToInterface() throws Exception {
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/quickfix/migration/traitToInterface"), Pattern.compile("^([\\w\\-_]+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("traitToInterface.kt")
|
||||
public void testTraitToInterface() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/migration/traitToInterface/traitToInterface.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("idea/testData/quickfix/modifiers")
|
||||
|
||||
Reference in New Issue
Block a user