2024-01-10 21:05:28 +00:00
|
|
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
2024-04-29 02:57:30 +00:00
|
|
|
import { assertEquals } from "@std/assert";
|
2024-05-30 09:17:29 +00:00
|
|
|
import * as windows from "./windows/mod.ts";
|
|
|
|
import * as posix from "./posix/mod.ts";
|
2024-01-10 21:05:28 +00:00
|
|
|
|
2024-05-30 09:17:29 +00:00
|
|
|
Deno.test("windows.joinGlobs() joins the glob patterns", function () {
|
|
|
|
assertEquals(
|
|
|
|
windows.joinGlobs(["foo", "*", "bar"]),
|
|
|
|
`foo\\*\\bar`,
|
|
|
|
);
|
|
|
|
assertEquals(
|
|
|
|
windows.joinGlobs([""], { globstar: true }),
|
|
|
|
".",
|
|
|
|
);
|
|
|
|
assertEquals(
|
|
|
|
windows.joinGlobs(["**", ".."], { globstar: true }),
|
|
|
|
`**\\..`,
|
|
|
|
);
|
|
|
|
});
|
|
|
|
|
|
|
|
Deno.test("windows.joinGlobs() joins the glob patterns", function () {
|
|
|
|
assertEquals(
|
|
|
|
posix.joinGlobs(["foo", "*", "bar"]),
|
|
|
|
`foo/*/bar`,
|
|
|
|
);
|
|
|
|
assertEquals(
|
|
|
|
posix.joinGlobs([""], { globstar: true }),
|
|
|
|
".",
|
|
|
|
);
|
|
|
|
assertEquals(
|
|
|
|
posix.joinGlobs(["**", ".."], { globstar: true }),
|
|
|
|
`**/..`,
|
|
|
|
);
|
2024-01-10 21:05:28 +00:00
|
|
|
});
|