+ const [iri, value] of Object.entries(exampleLEIRIReferences)
+ ) {
+ assertStrictEquals(composeReference(value), iri);
+ }
+ });
+});
+
+describe("escapeForIRI", () => {
+ it("[[Call]] converts L·E·I·R·Is to I·R·Is", () => {
+ assertStrictEquals(
+ escapeForIRI(" æ\0"),
+ "%20æ%00",
+ );
+ assertStrictEquals(
+ escapeForIRI("\u{F0000}?\u{F0000}#\u{F0000}"),
+ "%F3%B0%80%80?\u{F0000}#%F3%B0%80%80",
+ );
+ });
+});
+
+describe("escapeForURI", () => {
+ it("[[Call]] converts L·E·I·R·Is to U·R·Is", () => {
+ assertStrictEquals(
+ escapeForURI("/dir1/引き割り.html"),
+ "/dir1/%E5%BC%95%E3%81%8D%E5%89%B2%E3%82%8A.html",
+ );
+ assertStrictEquals(
+ escapeForURI(" æ\0"),
+ "%20%C3%A6%00",
+ );
+ assertStrictEquals(
+ escapeForURI("\u{F0000}?\u{F0000}#\u{F0000}"),
+ "%F3%B0%80%80?%F3%B0%80%80#%F3%B0%80%80",
+ );
+ });
+});
+
+describe("isAbsoluteIRI", () => {
+ it("[[Call]] identifies absolute I·R·Is", () => {
+ for (
+ const [iri, { scheme, fragment }] of Object.entries(
+ exampleReferences,
+ )