actors: Add cleanup facility to run-hive.
[8sync.git] / tests / test-actors.scm
index 68a05bf13a1b3c668f5c76430862fd06fe6410b1..0de89611110bba84b2c18246d0f14ce596a7024c 100644 (file)
@@ -139,5 +139,18 @@ lazy-rep> I'm not answering that.
 customer> Whaaaaat?  I can't believe I got voice mail!\n"
           displayed-text))))
 
+(define-simple-actor <foo>
+  (*cleanup* test-call-cleanup))
+
+(define (test-call-cleanup actor message)
+  (speak "Hey, I'm cleanin' up here!\n"))
+
+(with-fresh-speaker
+ (let ((hive (make-hive)))
+   (hive-create-actor hive <foo>)
+   (run-hive hive '()))
+ (test-equal '("Hey, I'm cleanin' up here!\n")
+   (get-spoken)))
+
 (test-end "test-actors")
 (test-exit)