* use import_map.json instead of per-file import * remove test_deps.ts in favor of import_map * remove common/deps.ts in favor of import_map * use import_map instead of server/deps.ts * make all plug-api files usable without an import_map * make all lib files usable without an import_map * remove web/deps.ts in favor of import_map * fix plug build * remove plug-api/deps.ts in favor of lib/deps.ts * fix server deps bundled in client deps
27 lines
630 B
TypeScript
27 lines
630 B
TypeScript
import { rangeLength, rangesOverlap } from "./change.ts";
|
|
import { assertEquals } from "$std/testing/asserts.ts";
|
|
|
|
Deno.test("rangeLength", () => {
|
|
assertEquals(rangeLength({ from: 4, to: 11 }), 7);
|
|
});
|
|
|
|
Deno.test("rangesOverlap", () => {
|
|
assertEquals(
|
|
rangesOverlap({ from: 0, to: 5 }, { from: 3, to: 8 }),
|
|
true,
|
|
);
|
|
assertEquals(
|
|
rangesOverlap({ from: 0, to: 5 }, { from: 6, to: 8 }),
|
|
false,
|
|
);
|
|
// `to` is exclusive
|
|
assertEquals(
|
|
rangesOverlap({ from: 0, to: 6 }, { from: 6, to: 8 }),
|
|
false,
|
|
);
|
|
assertEquals(
|
|
rangesOverlap({ from: 3, to: 6 }, { from: 0, to: 4 }),
|
|
true,
|
|
);
|
|
});
|