| ... | @@ -4,6 +4,8 @@ import { | ... | @@ -4,6 +4,8 @@ import { |
| 4 | isUncPath, | 4 | isUncPath, |
| 5 | isWindowsAbsolutePath, | 5 | isWindowsAbsolutePath, |
| 6 | isWindowsDrivePath, | 6 | isWindowsDrivePath, |
| | 7 | normalizeProjectPathForComparison, |
| | 8 | normalizeProjectPathForDispatch, |
| 7 | } from "./path.ts"; | 9 | } from "./path.ts"; |
| 8 | | 10 | |
| 9 | describe("path helpers", () => { | 11 | describe("path helpers", () => { |
| ... | @@ -31,4 +33,14 @@ describe("path helpers", () => { | ... | @@ -31,4 +33,14 @@ describe("path helpers", () => { |
| 31 | expect(isExplicitRelativePath("..\\repo")).toBe(true); | 33 | expect(isExplicitRelativePath("..\\repo")).toBe(true); |
| 32 | expect(isExplicitRelativePath("~/repo")).toBe(false); | 34 | expect(isExplicitRelativePath("~/repo")).toBe(false); |
| 33 | }); | 35 | }); |
| | 36 | |
| | 37 | it("normalizes a bare Windows drive root the same as one with a trailing separator", () => { |
| | 38 | // `C:`, `C:\` and `C:/` all refer to the drive root and must compare equal. |
| | 39 | expect(normalizeProjectPathForDispatch("C:")).toBe("C:\\"); |
| | 40 | expect(normalizeProjectPathForComparison("C:")).toBe("c:\\"); |
| | 41 | expect(normalizeProjectPathForComparison("C:")).toBe(normalizeProjectPathForComparison("C:\\")); |
| | 42 | expect(normalizeProjectPathForComparison("C:")).toBe(normalizeProjectPathForComparison("C:/")); |
| | 43 | // Non-root drive paths keep their trailing separator trimmed as before. |
| | 44 | expect(normalizeProjectPathForDispatch("C:\\repo\\")).toBe("C:\\repo"); |
| | 45 | }); |
| 34 | }); | 46 | }); |