;; Observe unchanged auxiliary XML bytes; never a registered original contract. (require :asdf) (assert (string= "2.5.4" (lisp-implementation-version))) (setf *compile-verbose* nil *load-verbose* nil) (asdf:load-asd (merge-pathnames "topic-maps.asd" (uiop:ensure-directory-pathname (uiop:getenv "TOPIC_MAPS_22A_ROOT")))) (asdf:load-system "topic-maps/xtm/tests") (in-package :topic-maps.xtm.tests) (let ((rows nil)) (dolist (id '("xtm2/in/mergemap-itemid.sub" "xtm2/in/mergemap-loop.sub")) (let* ((iri (concatenate 'string "https://xtm-tests.example.invalid/cd165b150176c1d6842b37be9cc9051b40d4996b/" id)) (raw (file-bytes (corpus-path id))) (copy (copy-seq raw)) (map nil) (c (handler-case (progn (setf map (deserialize-octets raw :document-iri iri :source-key id)) nil) (error (c) c))) (before (when map (map-reifier-state map))) (actual (when map (topic-maps.cxtm:canonicalize-octets map :base-locator iri)))) (assert (equalp raw copy)) (when map (assert (references-current-p map)) (assert (equalp actual (topic-maps.cxtm:canonicalize-octets map :base-locator iri))) (assert (equal before (map-reifier-state map)))) (push (topic-maps.test-foundation::fields "id" id "kind" "auxiliary-source-only-not-an-original-contract" "documentIRI" iri "sourceHex" (format nil "~{~2,'0X~}" (coerce raw 'list)) "sourceBytes" (length raw) "condition" (when c (negative-condition-data c)) "nativeModel" (when map (original-model-data map)) "mapItemIdentifiers" (when map (coerce (item-identifiers map) 'vector)) "actualCXTM" (when actual (babel:octets-to-string actual :encoding :utf-8)) "actualBytes" (when actual (length actual)) "canonicalizationPreservesMap" (when map :true) "referencesCurrent" (when map :true)) rows))) (assert (null *cases*)) (with-open-file (out (merge-pathnames "xtm-auxiliary.json" (uiop:ensure-directory-pathname (uiop:getenv "TOPIC_MAPS_22C_OUTPUT"))) :direction :output :if-exists :supersede :external-format :utf-8) (topic-maps.test-foundation::emit-json-value (coerce (nreverse rows) 'vector) out) (terpri out))) (format t "SLICE-22C-AUXILIARY: 2 unchanged subresources observed; no registrations~%")