]> dreyeck.freedombox.rocks Git - topic-maps.git/blob - reports/slice-21c/failure-controls.lisp
feat(xtm): support item identifiers on name variants
[topic-maps.git] / reports / slice-21c / failure-controls.lisp
1 ;; Fault-injection controls exercise the same ASDF executor. They do not add
2 ;; corpus results. Only the first new negative original's call is intercepted;
3 ;; all 26 positive originals must still execute successfully beforehand.
4 (require :asdf)
5 (assert (string= "2.5.4" (lisp-implementation-version)))
6 (setf *compile-verbose* nil *load-verbose* nil)
7 (asdf:load-asd (merge-pathnames "../../topic-maps.asd" *load-truename*))
8 (asdf:load-system "topic-maps/xtm/tests")
9 (let* ((mode (uiop:getenv "TOPIC_MAPS_21C_FAULT"))
10 (original (symbol-function 'topic-maps.xtm:deserialize-octets))
11 (text (cond ((string= mode "accepted") (topic-maps.xtm.tests::document "<topic id='valid'/>"))
12 ((string= mode "xml") "<a><b></a>")
13 ((string= mode "unsupported") (topic-maps.xtm.tests::document "<topic id='a'><name><value>N</value></name></topic>"))
14 ((string= mode "wrong-cause") (topic-maps.xtm.tests::document "<topic/>"))
15 (t (error "Unknown fault mode ~A" mode)))))
16 (setf (symbol-function 'topic-maps.xtm:deserialize-octets)
17 (lambda (raw &rest args)
18 (apply original
19 (if (equal "xtm2/invalid/id-invalid.xtm" (getf args :source-key))
20 (topic-maps.xtm.tests::bytes text) raw) args)))
21 (asdf:test-system "topic-maps/xtm"))
22 (error "Negative fault control unexpectedly completed without ASDF failure.")