deno.land / std@0.173.0 / path / common_test.ts

common_test.ts
نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.import { assertEquals } from "../testing/asserts.ts";import { common } from "./mod.ts";
Deno.test({ name: "path - common - basic usage", fn() { const actual = common( [ "file://deno/cli/js/deno.ts", "file://deno/std/path/mod.ts", "file://deno/cli/js/main.ts", ], "/", ); assertEquals(actual, "file://deno/"); },});
Deno.test({ name: "path - common - no shared", fn() { const actual = common( ["file://deno/cli/js/deno.ts", "https://deno.land/std/path/mod.ts"], "/", ); assertEquals(actual, ""); },});
Deno.test({ name: "path - common - windows sep", fn() { const actual = common( [ "c:\\deno\\cli\\js\\deno.ts", "c:\\deno\\std\\path\\mod.ts", "c:\\deno\\cli\\js\\main.ts", ], "\\", ); assertEquals(actual, "c:\\deno\\"); },});
std

Version Info

Tagged at
a year ago