19 lines
717 B
TypeScript
19 lines
717 B
TypeScript
import { describe, expect, it } from "bun:test";
|
|
import { stripWindowsExtendedLengthPathPrefix } from "../src/path";
|
|
|
|
describe("stripWindowsExtendedLengthPathPrefix", () => {
|
|
it("removes drive and UNC extended-length prefixes on Windows", () => {
|
|
expect(stripWindowsExtendedLengthPathPrefix("\\\\?\\C:\\Users\\Shi Xin\\omp.exe", "win32")).toBe(
|
|
"C:\\Users\\Shi Xin\\omp.exe",
|
|
);
|
|
expect(stripWindowsExtendedLengthPathPrefix("\\\\?\\UNC\\server\\share\\omp.exe", "win32")).toBe(
|
|
"\\\\server\\share\\omp.exe",
|
|
);
|
|
});
|
|
|
|
it("leaves non-Windows paths unchanged", () => {
|
|
const path = "\\\\?\\C:\\Users\\Shi Xin\\omp.exe";
|
|
expect(stripWindowsExtendedLengthPathPrefix(path, "linux")).toBe(path);
|
|
});
|
|
});
|