);
});
- it("[[Call]] returns null if passed an invalid I·R·I", () => {
- assertStrictEquals(Tag.fromIRI(`bad iri`), null);
+ it("[[Call]] throws if passed an invalid I·R·I", () => {
+ assertThrows(() => {Tag.fromIRI(`bad iri`)});
});
});
it("[[Call]] returns null if no tag with the given Tag U·R·I has been persisted", () => {
assertStrictEquals(
- Tag.fromIRI(`tag:${system.taggingEntity}:`),
+ Tag.fromTagURI(`tag:${system.taggingEntity}:`),
null,
);
assertStrictEquals(
- Tag.fromIRI(`tag:${system.taggingEntity}:000-0000`),
+ Tag.fromTagURI(`tag:${system.taggingEntity}:000-0000`),
null,
);
});
// `::iri` is tested by a `.fromIRI`.
+ // `::iriSpace` is tested by a `.fromIRI`.
+
// `::kind` is tested by the constructor.
describe("::narrowerTags", () => {
});
});
+ describe("::iriSpace", () => {
+ it("[[Get]] returns the I·R·I space", () => {
+ const system = new TagSystem("etaoin.example", "1972-12-31");
+ assertStrictEquals(
+ system.iriSpace,
+ "https://etaoin.example/tag:etaoin.example,1972-12-31:",
+ );
+ const system2 = new TagSystem(
+ "etaoin.example",
+ "1972-12-31",
+ "etaoin",
+ );
+ assertStrictEquals(
+ system2.iriSpace,
+ "https://etaoin.example/tag:etaoin.example,1972-12-31:",
+ );
+ });
+ });
+
describe("::tagURI", () => {
it("[[Get]] returns the Tag U·R·I", () => {
const system = new TagSystem("etaoin.example", "1972-12-31");