message: WIP: Add tests for declaration reference parsing
diff: @@ -2,6 +2,7 @@ import { deepStrictEqual as equal } from "assert";
  import {
  parseComponent,
  parseComponentPath,
  + parseDeclarationReference,
  parseMeaning,
  parseModuleSource,
  parseString,
  @@ -153,4 +154,52 @@ describe("Declaration References", () => {
  equal(parse("abc.def"), "abc.def");
  });
  });
  +
  + describe("Full reference parsing", () => {
  + const parse = (s: string) => parseDeclarationReference(s)?.[0];
  +
  + it("Parses module if there is one", () => {
  + equal(parse("abc!"), {
  + moduleSource: "abc",
  + resolutionStart: "global",
  + symbolReference: undefined,
  + });
  + });
  +
  + it("Does not parse module if there is not one", () => {
  + equal(parse("abc#def"), {
  + moduleSource: undefined,
  + resolutionStart: "local",
  + symbolReference: {
  + path: [
  + { navigation: ".", path: "abc" },
  + { navigation: "#", path: "def" },
  + ],
  + meaning: undefined,
  + },
  + });
  + });
  +
  + it("Supports referencing global symbols", () => {
  + equal(parse("!abc#def"), {
  + moduleSource: undefined,
  + resolutionStart: "global",
  + symbolReference: {
  + path: [
  + { navigation: ".", path: "abc" },
  + { navigation: "#", path: "def" },
  + ],
  + meaning: undefined,
  + },
  + });
  + });
  +
  + it("Doesn't crash with an empty reference", () => {
  + equal(parse(""), {
  + moduleSource: undefined,
  + resolutionStart: "local",
  + symbolReference: undefined,
  + });
  + });
  + });
  });
  