;; The existing positive/negative executor guards now use valid-but-excluded ;; Name Variant for Unsupported. Old reports and their historical fixtures stay ;; unchanged. Target one real contract in a disposable fresh ASDF process. (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" *load-truename*)) (asdf:load-system "topic-maps/xtm/tests") (let* ((family (uiop:getenv "TOPIC_MAPS_21F_FAMILY")) (mode (uiop:getenv "TOPIC_MAPS_21F_FAULT")) (target (cond ((string= family "positive") "xtm2/in/empty.xtm") ((string= family "negative") "xtm2/invalid/id-invalid.xtm") ((string= family "name") "xtm2/in/name.xtm") ((string= family "scope") "xtm2/in/name-scope.xtm") ((string= family "iid") "xtm2/in/itemid-name.xtm") (t (error "Unknown control family ~S" family))))) (if (string= mode "mismatch") (let ((saved (symbol-function 'topic-maps.cxtm:canonicalize-octets)) (iri (concatenate 'string "https://xtm-tests.example.invalid/cd165b150176c1d6842b37be9cc9051b40d4996b/" target))) (setf (symbol-function 'topic-maps.cxtm:canonicalize-octets) (lambda (map &rest args) (let ((actual (apply saved map args))) (if (equal iri (getf args :base-locator)) (let ((changed (copy-seq actual))) (setf (aref changed 0) (logxor 1 (aref changed 0))) changed) actual))))) (let* ((saved (symbol-function 'topic-maps.xtm:deserialize-octets)) (source (cond ((string= mode "xml") "") ((string= mode "unsupported") (topic-maps.xtm.tests::document "NV")) ((string= mode "tmdm") (topic-maps.xtm.tests::document "")) ((string= mode "xtm") (topic-maps.xtm.tests::document "")) ((string= mode "wrong-cause") (topic-maps.xtm.tests::document "")) ((string= mode "accepted") (topic-maps.xtm.tests::document "")) (t (error "Unknown control mode ~S" mode))))) (setf (symbol-function 'topic-maps.xtm:deserialize-octets) (lambda (raw &rest args) (apply saved (if (equal target (getf args :source-key)) (topic-maps.xtm.tests::bytes source) raw) args))))) (asdf:test-system "topic-maps/xtm")) (error "Fault injection did not cause the required ASDF failure.")