Skip to content

Commit 4e4f750

Browse files
committed
Fix getDefaultLibraryFile + turn off lib
1. getDefaultLibraryFile should use ts to normalise the file and find the filename. 2. lib should be turned off at the same time that noLib is turned on to avoid a pointless error.
1 parent ad18bde commit 4e4f750

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

src/harness/harness.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2146,8 +2146,8 @@ namespace Harness {
21462146
return filePath.indexOf(Harness.libFolder) === 0;
21472147
}
21482148

2149-
export function getDefaultLibraryFile(libPath: string, io: Harness.Io): Harness.Compiler.TestFile {
2150-
const libFile = Harness.userSpecifiedRoot + Harness.libFolder + libPath.slice(io.directoryName(libPath).length + 1);
2149+
export function getDefaultLibraryFile(filePath: string, io: Harness.Io): Harness.Compiler.TestFile {
2150+
const libFile = Harness.userSpecifiedRoot + Harness.libFolder + ts.getBaseFileName(ts.normalizeSlashes(filePath));
21512151
return { unitName: libFile, content: io.readFile(libFile) };
21522152
}
21532153

src/harness/rwcRunner.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ namespace RWC {
138138
}
139139

140140
// do not use lib since we already read it in above
141+
opts.options.lib = undefined;
141142
opts.options.noLib = true;
142143

143144
// Emit the results

0 commit comments

Comments
 (0)