1
0
silverbullet/plug-api/lib/cheap_yaml.test.ts
2023-12-22 13:59:16 +01:00

17 lines
694 B
TypeScript

import { assertEquals } from "../../test_deps.ts";
import { determineTags } from "./cheap_yaml.ts";
Deno.test("cheap yaml", () => {
assertEquals([], determineTags(""));
assertEquals([], determineTags("hank: bla"));
assertEquals(["template"], determineTags("tags: template"));
assertEquals(["bla", "template"], determineTags("tags: bla,template"));
assertEquals(["bla", "template"], determineTags("tags:\n- bla\n- template"));
assertEquals(["bla", "template"], determineTags(`tags: "#bla,#template"`));
assertEquals(["bla", "template"], determineTags(`tags: '#bla, #template'`));
assertEquals(
["bla", "template"],
determineTags(`tags:\n- "#bla"\n- template`),
);
});