* 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
25 lines
678 B
TypeScript
25 lines
678 B
TypeScript
import { assertEquals } from "$std/testing/asserts.ts";
|
|
import { parseCommand } from "./command.ts";
|
|
|
|
Deno.test("Command parser", () => {
|
|
assertEquals(parseCommand("Hello world"), { name: "Hello world", args: [] });
|
|
assertEquals(parseCommand("{[Hello world]}"), {
|
|
name: "Hello world",
|
|
args: [],
|
|
});
|
|
assertEquals(parseCommand("{[Hello world|sup]}"), {
|
|
name: "Hello world",
|
|
alias: "sup",
|
|
args: [],
|
|
});
|
|
assertEquals(parseCommand("{[Hello world](1, 2, 3)}"), {
|
|
name: "Hello world",
|
|
args: [1, 2, 3],
|
|
});
|
|
assertEquals(parseCommand("{[Hello world|sup](1, 2, 3)}"), {
|
|
name: "Hello world",
|
|
alias: "sup",
|
|
args: [1, 2, 3],
|
|
});
|
|
});
|