X-Git-Url: https://jxself.org/git/?p=8sync.git;a=blobdiff_plain;f=tests%2Ftest-actors.scm;h=aad93b5a03e23dc9e3ddef7568b0626416042b9f;hp=df98b86c3e41f9b4ede3b80b1bdc4870a9f0c9ad;hb=17830fd9912894b6a30a5c4a4a83722a74c01ccd;hpb=bac7d5aece0b6687f7f55a235ae7c2969ea6d184 diff --git a/tests/test-actors.scm b/tests/test-actors.scm index df98b86..aad93b5 100644 --- a/tests/test-actors.scm +++ b/tests/test-actors.scm @@ -139,7 +139,10 @@ lazy-rep> I'm not answering that. customer> Whaaaaat? I can't believe I got voice mail!\n" displayed-text)))) -(define-simple-actor + +;;; Cleanup tests + +(define-simple-actor (*clean-up* test-call-clean-up)) (define (test-call-clean-up actor message) @@ -147,10 +150,30 @@ customer> Whaaaaat? I can't believe I got voice mail!\n" (with-fresh-speaker (let ((hive (make-hive))) - (hive-create-actor hive ) + (hive-create-actor hive ) (run-hive hive '())) (test-equal '("Hey, I'm cleanin' up here!\n") (get-spoken))) +;; won't work if we turn off #:clean-up though + +(with-fresh-speaker + (let ((hive (make-hive))) + (hive-create-actor hive ) + (run-hive hive '() #:clean-up #f)) + (test-equal '("Hey, I'm cleanin' up here!\n") + (get-spoken))) + +;; The exploder self-destructs, even though run-hive has clean-up +;; disabled, because it cleans up on self-destruct. + +(with-fresh-speaker + (let ((hive (make-hive))) + (define exploder (hive-create-actor hive )) + (run-hive hive (list (bootstrap-message hive exploder 'explode)) + #:clean-up #f)) + (get-spoken)) + + (test-end "test-actors") (test-exit)