Skip to content

Commit b8e814e

Browse files
authored
Harden compilerRunner vs rooted path names in tests (microsoft#9714)
* Harden compilerRunner vs rooted path names in tests * Call toPath on currentDirectory
1 parent 3cb0513 commit b8e814e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/harness/compilerRunner.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ class CompilerBaselineRunner extends RunnerBase {
5050
}
5151

5252
private makeUnitName(name: string, root: string) {
53-
return ts.isRootedDiskPath(name) ? name : ts.combinePaths(root, name);
53+
const path = ts.toPath(name, root, (fileName) => Harness.Compiler.getCanonicalFileName(fileName));
54+
const pathStart = ts.toPath(Harness.IO.getCurrentDirectory(), "", (fileName) => Harness.Compiler.getCanonicalFileName(fileName));
55+
return path.replace(pathStart, "/");
5456
};
5557

5658
public checkTestCodeOutput(fileName: string) {

0 commit comments

Comments
 (0)