From: Christopher Allan Webber Date: Fri, 22 Apr 2016 03:46:59 +0000 (-0500) Subject: tests: test-actors: Start testing the actor model X-Git-Tag: v0.2.0~66 X-Git-Url: https://jxself.org/git/?p=8sync.git;a=commitdiff_plain;h=011f388e6b4f21d53685982c847826799fbe0c88;ds=sidebyside tests: test-actors: Start testing the actor model There's not much here yet. * tests/test-actors.scm: New file. --- diff --git a/tests/test-actors.scm b/tests/test-actors.scm new file mode 100644 index 0000000..fa33922 --- /dev/null +++ b/tests/test-actors.scm @@ -0,0 +1,32 @@ +(define-module (tests test-actors) + #:use-module (srfi srfi-64) + #:use-module (8sync systems actors) + #:use-module (tests utils)) + +(test-begin "test-actors") + + +;;; Actor utilities +;;; =============== + +;;; Message tests +;;; ============= + +(let ((monkey-message + (make-message 'id 'to 'from 'action + '((monkey . banana))))) + ;; A key we have + (test-equal (message-ref monkey-message 'monkey) + 'banana) + + ;; A key we don't have + (test-equal (message-ref monkey-message 'coo-coo) + #f) + + ;; A key we don't have, with a default set + (test-equal (message-ref monkey-message 'coo-coo 'danger-danger) + 'danger-danger)) + + +(test-end "test-agenda") +(test-exit)