mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-16 07:13:45 -05:00
Deduplicate inputfiles before running RWC tests (#17877)
* Deduplicate inputfiles before running RWC tests We deduplicate in the compiler, but we don't in the harness - this causes tests where the same file is listed multiple times in the arguments to not have the expected errors written, because we write out the same file multiple times when we should not. * Don't completely omit both copied of duplicates * Remove trailing whitespace * Maintain list order while filtering duplicates * Merge adjacent loops
This commit is contained in:
@@ -90,9 +90,16 @@ namespace RWC {
|
||||
ts.setConfigFileInOptions(opts.options, configParseResult.options.configFile);
|
||||
}
|
||||
|
||||
// Load the files
|
||||
// Deduplicate files so they are only printed once in baselines (they are deduplicated within the compiler already)
|
||||
const uniqueNames = ts.createMap<true>();
|
||||
for (const fileName of fileNames) {
|
||||
inputFiles.push(getHarnessCompilerInputUnit(fileName));
|
||||
// Must maintain order, build result list while checking map
|
||||
const normalized = ts.normalizeSlashes(fileName);
|
||||
if (!uniqueNames.has(normalized)) {
|
||||
uniqueNames.set(normalized, true);
|
||||
// Load the file
|
||||
inputFiles.push(getHarnessCompilerInputUnit(fileName));
|
||||
}
|
||||
}
|
||||
|
||||
// Add files to compilation
|
||||
|
||||
Reference in New Issue
Block a user