Normalize tmp path to ensure correct comparrison on windows
This commit is contained in:
@@ -51,7 +51,7 @@ export async function getDirectoryNamesInsidePath(
|
||||
return dirNames;
|
||||
}
|
||||
|
||||
function normalizePath(path: string): string {
|
||||
export function normalizePath(path: string): string {
|
||||
// On Windows, "C:/", "C:\", and "c:/" are all equivalent. We need
|
||||
// to normalize the paths to ensure they all get resolved to the
|
||||
// same format. On Windows, we also need to do the comparison
|
||||
|
||||
@@ -10,6 +10,7 @@ import { FilePathDiscovery } from "../../../../../src/common/vscode/file-path-di
|
||||
import { basename, dirname, join } from "path";
|
||||
import { mkdirSync, readFileSync, rmSync, writeFileSync } from "fs";
|
||||
import * as tmp from "tmp";
|
||||
import { normalizePath } from "../../../../../src/pure/files";
|
||||
|
||||
interface TestData {
|
||||
path: string;
|
||||
@@ -75,7 +76,7 @@ describe("FilePathDiscovery", () => {
|
||||
|
||||
beforeEach(() => {
|
||||
const t = tmp.dirSync();
|
||||
tmpDir = t.name;
|
||||
tmpDir = normalizePath(t.name);
|
||||
tmpDirRemoveCallback = t.removeCallback;
|
||||
|
||||
workspaceFolder = {
|
||||
|
||||
Reference in New Issue
Block a user