X-Git-Url: https://jxself.org/git/?p=8sync.git;a=blobdiff_plain;f=tests%2Ftest-actors.scm;h=4c8795a75f089dd263287ff532a4a8b4ae02f7c2;hp=2b5298c81e7e73059a7f46950cfcceabf928667d;hb=171dbab2f07df50ac5b1daedfbef6d60860b7935;hpb=a13568ea3ac0aab789e7a6d6f8530dbb61a9e872 diff --git a/tests/test-actors.scm b/tests/test-actors.scm index 2b5298c..4c8795a 100644 --- a/tests/test-actors.scm +++ b/tests/test-actors.scm @@ -98,13 +98,13 @@ (define-simple-actor ((pester-rep actor message) (~display "customer> I'm calling customer service about this!\n") - (let ((reply (send-message-wait actor (message-ref message 'who-to-call) - 'field-call))) + (let ((reply (<-wait actor (message-ref message 'who-to-call) + 'field-call))) (if (message-ref reply '*auto-reply* #f) (~display "customer> Whaaaaat? I can't believe I got voice mail!\n") (begin (~format "*customer hears*: ~a\n" (message-ref reply 'msg)) - (let ((reply (reply-message-wait + (let ((reply (<-reply-wait actor reply #:msg "Yes, it didn't work, I'm VERY ANGRY!"))) (if (message-ref reply '*auto-reply* #f) @@ -115,7 +115,7 @@ ((field-call actor message) (~display "good-rep> Hm, another call from a customer...\n") (let ((reply - (reply-message-wait + (<-reply-wait actor message #:msg "Have you tried turning it off and on?"))) (~format "*rep hears*: ~a\n" (message-ref reply 'msg)) @@ -126,17 +126,14 @@ (~display "lazy-rep> I'm not answering that.\n"))) (let* ((hive (make-hive)) - (customer (hive-create-actor hive - #:id-cookie "antsy-caller")) - (diligent-rep (hive-create-actor hive - #:id-cookie "diligent-rep")) - (lazy-rep (hive-create-actor hive - #:id-cookie "lazy-rep"))) + (customer (hive-create-actor* hive "antsy-caller")) + (diligent-rep (hive-create-actor* hive "diligent-rep")) + (lazy-rep (hive-create-actor* hive "lazy-rep"))) ;; * Playing a tape of a diligent service rep * (parameterize ((%record-out (open-output-string))) (let* ((result (ez-run-hive hive - (list (hive-bootstrap-message hive customer 'pester-rep + (list (bootstrap-message hive customer 'pester-rep #:who-to-call diligent-rep)))) (displayed-text (get-output-string (%record-out)))) (test-equal @@ -151,7 +148,7 @@ customer> Well then! Harumph.\n"))) (parameterize ((%record-out (open-output-string))) (let* ((result (ez-run-hive hive - (list (hive-bootstrap-message hive customer 'pester-rep + (list (bootstrap-message hive customer 'pester-rep #:who-to-call lazy-rep)))) (displayed-text (get-output-string (%record-out)))) (test-equal