]> dreyeck.freedombox.rocks Git - topic-maps.git/blobdiff - tests/ctm-prefixes.lisp
Implement Date Occurrences with lexical validation and CXTM canonicalization
[topic-maps.git] / tests / ctm-prefixes.lisp
index 8c030995f95f8030a4b7a0397796497d3d00c719..d5977c7cc1aba5a8e5f252188e39a5cca9fa6dee 100644 (file)
     (check "explicit-anyuri-cxtm-locator-rule" (search "<value>#z</value>" (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 (if (equal name "date") "2000-01-01" "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=)
+             (and (string= dt (topic-maps.tmdm:occurrence-datatype o)) (string= value (topic-maps.tmdm:occurrence-value o))))
+      (if (member name '("integer" "decimal" "date") :test #'string=)
           (check (concatenate 'string name "-explicit-cxtm-now-supported")
-                 (and (null c) (search (if (string= name "integer") "<value>42</value>" "<value>42.0</value>")
+                 (and (null c) (search (cond ((string= name "integer") "<value>42</value>") ((string= name "decimal") "<value>42.0</value>") (t "<value>2000-01-01</value>"))
                                        (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)))))))