std/path/normalize_test.ts
2024-06-03 21:44:23 +09:00

17 lines
560 B
TypeScript

// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { assertEquals } from "@std/assert";
import * as windows from "./windows/mod.ts";
import * as posix from "./posix/mod.ts";
Deno.test(`normalize() returns "." if input is empty`, function () {
assertEquals(posix.normalize(""), ".");
assertEquals(windows.normalize(""), ".");
});
Deno.test("windows.normalize() normalizes windows specific paths", () => {
assertEquals(
windows.normalize("//server/share/dir/file.ext"),
"\\\\server\\share\\dir\\file.ext",
);
});