(defvar *fixture* nil)
(defvar *negative-outputs* nil)
(defvar *negative-controls* nil)
+(defvar *name-outputs* nil)
+(defvar *name-controls* nil)
(defun check (name truth)
(push name *checks*)
(unless truth (error "XTM test failed: ~A" name))
(dolist (spec (list (list "xml" "<a><b></a>" 'xtm-xml-error :fail)
(list "xtm" (document "<topic id='2bad'/>") 'xtm-rejection :fail)
(list "tmdm" (document "<itemIdentity href='#a'/><topic id='a'/>") 'item-identifier-error :fail)
- (list "unsupported" (document "<topic id='a'><name><value>N</value></name></topic>") 'xtm-unsupported :unsupported)))
+ (list "unsupported" (document "<topic id='a'><name><scope><topicRef href='#s'/></scope><value>N</value></name></topic>") 'xtm-unsupported :unsupported)))
(let ((case (case-record))
(c (condition-from (lambda () (deserialize-octets (bytes (second spec)) :document-iri *document*)))))
(record-original-result case nil #() c)
"<!DOCTYPE topicMap SYSTEM 'http://127.0.0.1:9/no-xtm-network'>"
"<!DOCTYPE topicMap [<!ENTITY e SYSTEM 'file:///tmp/no-xtm-file'>]>"))
(rejection (concatenate 'string "doctype:" body) (concatenate 'string body (document "")) 'xtm-xml-error :doctype-forbidden))
- (dolist (spec '(("unsupported-name" "<topic id='a'><name><value>Name</value></name></topic>" :unsupported-construct)
+ (dolist (spec '(("unsupported-name-scope" "<topic id='a'><name><scope><topicRef href='#s'/></scope><value>Name</value></name></topic>" :unsupported-construct)
("unsupported-occurrence" "<topic id='a'><occurrence><type><topicRef href='#t'/></type><resourceData>v</resourceData></occurrence></topic>" :unsupported-construct)
("unsupported-association" "<association><type><topicRef href='#t'/></type><role><type><topicRef href='#r'/></type><topicRef href='#p'/></role></association>" :unsupported-construct)
("unsupported-mergemap" "<mergeMap href='other.xtm'/>" :unsupported-construct)))
(setf *fixture* map)))
(defun run-tests ()
- (setf *checks* nil *fixture* nil *negative-outputs* nil *negative-controls* nil)
+ (setf *checks* nil *fixture* nil *negative-outputs* nil *negative-controls* nil *name-outputs* nil *name-controls* nil)
(handler-case
- (progn (original-contracts) (negative-original-controls) (negative-original-contracts) (result-classification-tests)
+ (progn (original-contracts) (negative-original-controls) (negative-original-contracts)
+ (name-original-contracts) (name-tests) (result-classification-tests)
(semantic-tests) (identity-cascade-tests) (negative-tests) (helper-source-test))
(error (condition)
;; Preserve the actual failed outcome before ASDF propagates the failure.
(array (items) (coerce items 'vector)))
(with-open-file (out pathname :direction :output :if-exists :supersede :external-format :utf-8)
(topic-maps.test-foundation::emit-json-value
- (fields "scope" "XTM 2.0 identity subset, 26 positive and seven cause-qualified negative original contracts; no CTM Mergemap integration"
+ (fields "scope" "XTM 2.0 identity subset, 36 positive and seven cause-qualified negative original contracts; no CTM Mergemap integration"
"corpusCommit" "cd165b150176c1d6842b37be9cc9051b40d4996b"
"statuses" (fields "pass" (count :pass cases :key #'topic-maps.test-foundation:test-case-status)
"fail" (count :fail cases :key #'topic-maps.test-foundation:test-case-status)
"ctmMergemapContract" "NOT-RUN; direct helper deserialization only")
"negativeOriginals" (array *negative-outputs*)
"negativeControls" (array *negative-controls*)
+ "nameOriginals" (array *name-outputs*)
+ "nameControls" (array *name-controls*)
"actualAndExpected" (array (loop for (id actual expected model condition source-length) in *outputs* collect
(fields "id" id "actual" (when actual (babel:octets-to-string actual :encoding :utf-8))
"expected" (babel:octets-to-string expected :encoding :utf-8) "byteLength" (when actual (length actual))