X-Git-Url: https://dreyeck.freedombox.rocks/gitweb/topic-maps.git/blobdiff_plain/195d5f5444d776096b765d04c815c23c3db5f84c..8741d155d948c7317945eee423a977940cad995e:/tests/ctm-prefixes.lisp diff --git a/tests/ctm-prefixes.lisp b/tests/ctm-prefixes.lisp index 8c03099..e0cf351 100644 --- a/tests/ctm-prefixes.lisp +++ b/tests/ctm-prefixes.lisp @@ -167,16 +167,17 @@ (check "explicit-anyuri-cxtm-locator-rule" (search "#z" (cxtm map)))) (dolist (name '("integer" "decimal" "date" "dateTime")) (let* ((dt (concatenate 'string "http://www.w3.org/2001/XMLSchema#" name)) - (map (read-text (format nil "a t:\"00042\"^^<~A>." dt))) (o (first (all-occurrences map))) + (value (cond ((equal name "date") "2000-01-01") ((equal name "dateTime") "2000-01-01T00:00:00.1200Z") (t "00042"))) + (map (read-text (format nil "a t:\"~A\"^^<~A>." value dt))) (o (first (all-occurrences map))) (state (map-state map)) (c (cxtm-condition (lambda () (cxtm map))))) (check (concatenate 'string "excluded-normalization-model-preserves:" name) - (and (string= dt (topic-maps.tmdm:occurrence-datatype o)) (string= "00042" (topic-maps.tmdm:occurrence-value o)))) - (if (member name '("integer" "decimal") :test #'string=) - (check (concatenate 'string name "-explicit-cxtm-now-supported") - (and (null c) (search (if (string= name "integer") "42" "42.0") - (cxtm map)) (equal state (map-state map)))) - (check (concatenate 'string "excluded-normalization-explicit-cxtm-unsupported:" name) - (and (typep c 'topic-maps.cxtm:cxtm-unsupported) (eq :unsupported-occurrence-datatype (topic-maps.cxtm:error-code c)) (equal state (map-state map))))))) + (and (string= dt (topic-maps.tmdm:occurrence-datatype o)) (string= value (topic-maps.tmdm:occurrence-value o)))) + (check (concatenate 'string name "-explicit-cxtm-now-supported") + (and (null c) (search (cond ((string= name "integer") "42") + ((string= name "decimal") "42.0") + ((string= name "dateTime") "2000-01-01T00:00:00.12Z") + (t "2000-01-01")) (cxtm map)) + (equal state (map-state map)))))) (let* ((map (read-text "%prefix xsd a t:\"Same\"; t:\"Same\"^^xsd:string."))) (check "implicit-explicit-string-datatypes-have-identical-equality" (= 1 (length (all-occurrences map))))) (let* ((value (concatenate 'string "<&>" (map 'string #'code-char '(101 769))))