]> dreyeck.freedombox.rocks Git - topic-maps.git/blobdiff - tests/xtm-variants.lisp
Integrate qualified XML anyType values into the XTM reader
[topic-maps.git] / tests / xtm-variants.lisp
index d3b2461b85c0dd88ee7a206b9cf1d05019b733c3..dbba2cd738e0549bbfa350723331ffd64f6e22e2 100644 (file)
         "sourceText" (document body) "model" (variant-model-data map)
         "actualCXTM" (babel:octets-to-string actual :encoding :utf-8)) *variant-controls*))))
 (defun variant-error-control (label body class code)
         "sourceText" (document body) "model" (variant-model-data map)
         "actualCXTM" (babel:octets-to-string actual :encoding :utf-8)) *variant-controls*))))
 (defun variant-error-control (label body class code)
-  (let* ((key (concatenate 'string "variant-syntax:" label)) (source (document body))
+  (let* ((key (concatenate 'string "variant-syntax:" label)) (source (ss-unsupported-source (document body) code label))
          (c (condition-from (lambda () (deserialize-octets (bytes source) :document-iri *document* :source-key key)))))
     (check (concatenate 'string key ":class-code")
       (and (eq class (type-of c)) (eq code (cond ((typep c 'topic-maps.xtm:xtm-error) (error-code c))
          (c (condition-from (lambda () (deserialize-octets (bytes source) :document-iri *document* :source-key key)))))
     (check (concatenate 'string key ":class-code")
       (and (eq class (type-of c)) (eq code (cond ((typep c 'topic-maps.xtm:xtm-error) (error-code c))
     ("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)))
     ("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-integer" "<variant><scope><topicRef href='#s'/></scope><resourceData datatype='http://www.w3.org/2001/XMLSchema#integer'>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#integer'>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#integer'>42</resourceData></variant>" :resource-data-datatype)
-    ("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-resolver-required)
+    ("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-resolver-required)
+    ("reifier-excluded-datatype" "<variant reifier='#r'><scope><topicRef href='#s'/></scope><resourceData datatype='http://www.w3.org/2001/XMLSchema#anyType'>42</resourceData></variant>" :resource-resolver-required)
+    ("datatype" "<variant><scope><topicRef href='#s'/></scope><resourceData datatype='http://www.w3.org/2001/XMLSchema#anyType'>V</resourceData></variant>" :resource-resolver-required)
+    ("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-resolver-required)))
     (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 ()
     (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 ()