Skip to content

Commit

Permalink
Drop the '.jsdata' file extension when naming parameterized SourceMap…
Browse files Browse the repository at this point in the history
…JsLangTetst test cases. This follows the existing naming convention for the test input files, but dropping the extension from the test case name yields more useful test result output.

PiperOrigin-RevId: 635834194
  • Loading branch information
12wrigja authored and copybara-github committed May 21, 2024
1 parent ec334ba commit 29b2b21
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/com/google/javascript/jscomp/SourceMapJsLangTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ public final class SourceMapJsLangTest extends SourceMapTestCase {
public static ImmutableList<? extends Object> data() {
ImmutableList.Builder<String> testFiles = ImmutableList.builder();
for (File testFile : new File(DATA_DIR).listFiles()) {
testFiles.add(testFile.getName());
if (!testFile.getName().endsWith(".jsdata")) {
continue;
}
testFiles.add(
testFile.getName().substring(0, testFile.getName().length() - ".jsdata".length()));
}
return testFiles.build();
}
Expand All @@ -72,7 +76,7 @@ public static ImmutableList<? extends Object> data() {

public SourceMapJsLangTest(String fileName) throws Exception {
this.fileName = fileName;
this.fileContent = Files.asCharSource(new File(DATA_DIR, fileName), UTF_8).read();
this.fileContent = Files.asCharSource(new File(DATA_DIR, fileName + ".jsdata"), UTF_8).read();
this.prettyPrinted = false;
this.inputMaps = ImmutableMap.builder();
}
Expand Down

0 comments on commit 29b2b21

Please sign in to comment.