diff options
author | Christopher Allan Webber <cwebber@dustycloud.org> | 2016-04-21 22:46:59 -0500 |
---|---|---|
committer | Christopher Allan Webber <cwebber@dustycloud.org> | 2016-04-25 09:25:35 -0500 |
commit | 011f388e6b4f21d53685982c847826799fbe0c88 (patch) | |
tree | ac4c4bca925ec5da703af81693a5945cd84c5647 /tests | |
parent | 3c40164d37f2a11e9439261625c9dd4385a27350 (diff) | |
download | 8sync-011f388e6b4f21d53685982c847826799fbe0c88.tar.gz |
tests: test-actors: Start testing the actor model
There's not much here yet.
* tests/test-actors.scm: New file.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test-actors.scm | 32 |
1 files changed, 32 insertions, 0 deletions
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) |