formats.exposed/test/png/nodePath.test.ts

21 lines
586 B
TypeScript

import { assert, assertEquals } from "assert";
import { isEqualTo, isSupersetOf, parse } from "../../public/png/nodePath.js";
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]));
});