2023-08-02 19:49:25 +00:00
|
|
|
import { assert, assertEquals } from "assert";
|
2023-08-12 03:40:30 +00:00
|
|
|
import {
|
|
|
|
isEqualTo,
|
|
|
|
isSupersetOf,
|
|
|
|
parse,
|
|
|
|
} from "../../public/common/nodePath.js";
|
2023-08-02 19:49:25 +00:00
|
|
|
|
|
|
|
Deno.test("parse", () => {
|
|
|
|
assertEquals(parse(""), []);
|
|
|
|
assertEquals(parse("1"), [1]);
|
|
|
|
assertEquals(parse("1,2,3"), [1, 2, 3]);
|
|
|
|
});
|
|
|
|
|
|
|
|
Deno.test("isEqualTo", () => {
|
|
|
|
assert(isEqualTo([], []));
|
|
|
|
assert(isEqualTo([1, 2, 3], [1, 2, 3]));
|
|
|
|
assert(!isEqualTo([1, 2], [1, 2, 3]));
|
|
|
|
});
|
|
|
|
|
|
|
|
Deno.test("isSupersetOf", () => {
|
|
|
|
assert(isSupersetOf([1, 2, 3], [1, 2, 3]));
|
|
|
|
assert(isSupersetOf([1, 2], [1, 2, 3]));
|
|
|
|
assert(!isSupersetOf([1, 2, 3], [1, 2]));
|
|
|
|
});
|