diff --git a/syndicate/syntax.rkt b/syndicate/syntax.rkt index 57292ed..3cbe957 100644 --- a/syndicate/syntax.rkt +++ b/syndicate/syntax.rkt @@ -623,6 +623,27 @@ ;; ;; (plus the exception report for "Deliberate error") + (spawn #:assertions ['marker] + (assert 'marker) ;; NB this is the change wrt the test case immediately below + (error 'test-case "Deliberate error") + (void)) + + (spawn (on (asserted 'marker) (printf "marker appeared\n")) + (on (retracted 'marker) (printf "marker disappeared\n"))) + ) + + #;(lambda () + ;; Goal: no matter the circumstances (e.g. exception in a + ;; stop script), we will never retract an assertion more or + ;; fewer than the correct number of times. + + ;; Expected output: + ;; + ;; marker appeared + ;; marker disappeared + ;; + ;; (plus the exception report for "Deliberate error") + (spawn #:assertions ['marker] (error 'test-case "Deliberate error") (void))