]> dreyeck.freedombox.rocks Git - topic-maps.git/blobdiff - tests/ctm-references.lisp
feat: support basic XTM topic names (slice 21D)
[topic-maps.git] / tests / ctm-references.lisp
index 30814848185fd3d660bdf0f5c0d00ca0125d98ab..1ccce7e59cfb7025151fe62c92d50d58717a6b0a 100644 (file)
     (check (concatenate 'string "embedded:role-layout-preserved:" text) (references-current-p (read-text text))))
   (dolist (text '("a - [-\"N\" ~r]:\"X\"." "a - \"N\"@[-\"T\"] ~r."
                   "def tpl() a. end" "%include <file.ctm>" "%mergemap <file.ctm> <urn:ctm>"))
     (check (concatenate 'string "embedded:role-layout-preserved:" text) (references-current-p (read-text text))))
   (dolist (text '("a - [-\"N\" ~r]:\"X\"." "a - \"N\"@[-\"T\"] ~r."
                   "def tpl() a. end" "%include <file.ctm>" "%mergemap <file.ctm> <urn:ctm>"))
-    (check (concatenate 'string "references:feature-boundary:" text)
-           (if (find #\~ text) (null (ctm-condition text)) (typep (ctm-condition text) 'topic-maps.ctm:ctm-unsupported))))
+    (check (if (search "%include" text) "references:Include-requires-explicit-resolver"
+               (concatenate 'string "references:feature-boundary:" text))
+           (cond ((search "def " text) (null (topic-map-topics (read-text text))))
+                 ((find #\~ text) (null (ctm-condition text)))
+                 ((search "%include" text)
+                  (let ((c (ctm-condition text)))
+                    (and (typep c 'topic-maps.ctm:ctm-unsupported)
+                         (eq :resource-resolver-required (topic-maps.ctm:error-code c)))))
+                 ((search "%mergemap" text)
+                  (let ((c (ctm-condition text)))
+                    (and (typep c 'topic-maps.ctm:ctm-rejection)
+                         (eq :unknown-mergemap-notation (topic-maps.ctm:error-code c)))))
+                 (t (typep (ctm-condition text) 'topic-maps.ctm:ctm-unsupported)))))
   (check "references:feature-boundary:a(r: b, s: c, t: d)"
          (references-current-p (read-text "a(r: b, s: c, t: d)")))
   (dolist (text '("a isa b." "a ako b."))
   (check "references:feature-boundary:a(r: b, s: c, t: d)"
          (references-current-p (read-text "a(r: b, s: c, t: d)")))
   (dolist (text '("a isa b." "a ako b."))