]> dreyeck.freedombox.rocks Git - topic-maps.git/blobdiff - tests/xtm-variants.lisp
Register five original XTM mergeMap contracts (Slice 22H)
[topic-maps.git] / tests / xtm-variants.lisp
index b323a1e1fe0e6102b88209050833adc9b43e8c0d..76e8f520091825c61e618f70378d617f76abfe69 100644 (file)
@@ -38,7 +38,7 @@
         (topic-maps.test-foundation::fields "value" (variant-value v) "datatype" (variant-datatype v)
           "parentName" (1+ (position (variant-parent v) names :test #'eq))
           "scope" (coerce (mapcar (lambda (theme) (1+ (position theme topics :test #'eq))) (variant-scope v)) 'vector)
-          "itemIdentifiers" (coerce (item-identifiers v) 'vector) "reifier" nil)) 'vector))))
+          "itemIdentifiers" (coerce (item-identifiers v) 'vector) "reifier" (when (item-reifier v) (1+ (position (item-reifier v) topics :test #'eq))))) 'vector))))
 
 (defun variant-original-model-checks (spec map raw)
   (destructuring-bind (id count name-scope-ids variant-scope-ids source-count) spec
     ("bad-href" "<variant><scope><topicRef href='#2bad'/></scope><resourceData>V</resourceData></variant>" :invalid-topic-ref)
     ("resourceRef-missing-href" "<variant><scope><topicRef href='#s'/></scope><resourceRef/></variant>" :missing-attribute)))
     (variant-error-control (first row) (format nil "<topic id='a'><name><value>N</value>~A</name></topic>" (second row)) 'xtm-rejection (third row)))
-  (dolist (row '(("resourceData-anyURI" "<variant><scope><topicRef href='#s'/></scope><resourceData datatype='http://www.w3.org/2001/XMLSchema#anyURI'>urn:x</resourceData></variant>" :resource-data-datatype)
-    ("itemIdentity" "<variant><itemIdentity href='urn:v'/><scope><topicRef href='#s'/></scope><resourceData>V</resourceData></variant>" :unsupported-construct)
-    ("reifier" "<variant reifier='#r'><scope><topicRef href='#s'/></scope><resourceData>V</resourceData></variant>" :reification)
-    ("datatype" "<variant><scope><topicRef href='#s'/></scope><resourceData datatype='urn:other'>V</resourceData></variant>" :resource-data-datatype)
-    ("embedded-XML" "<variant><scope><topicRef href='#s'/></scope><resourceData><b xmlns='urn:other'>V</b></resourceData></variant>" :resource-data-markup)))
+  (dolist (row '(("resourceData-anyType" "<variant><scope><topicRef href='#s'/></scope><resourceData datatype='http://www.w3.org/2001/XMLSchema#anyType'>42</resourceData></variant>" :resource-data-datatype)
+    ("reified-itemIdentity-excluded-datatype" "<variant reifier='#r'><itemIdentity href='urn:v'/><scope><topicRef href='#s'/></scope><resourceData datatype='http://www.w3.org/2001/XMLSchema#anyType'>42</resourceData></variant>" :resource-data-datatype)
+    ("reifier-excluded-datatype" "<variant reifier='#r'><scope><topicRef href='#s'/></scope><resourceData datatype='http://www.w3.org/2001/XMLSchema#anyType'>42</resourceData></variant>" :resource-data-datatype)
+    ("datatype" "<variant><scope><topicRef href='#s'/></scope><resourceData datatype='http://www.w3.org/2001/XMLSchema#anyType'>V</resourceData></variant>" :resource-data-datatype)
+    ("embedded-XML" "<variant><scope><topicRef href='#s'/></scope><resourceData datatype='http://www.w3.org/2001/XMLSchema#anyType'><b xmlns='urn:other'>V</b></resourceData></variant>" :resource-data-datatype)))
     (variant-error-control (first row) (format nil "<topic id='a'><name><value>N</value>~A</name></topic>" (second row)) 'xtm-unsupported (third row))))
 
 (defun variant-tests ()