From 011f388e6b4f21d53685982c847826799fbe0c88 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Thu, 21 Apr 2016 22:46:59 -0500 Subject: tests: test-actors: Start testing the actor model There's not much here yet. * tests/test-actors.scm: New file. --- tests/test-actors.scm | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 tests/test-actors.scm 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) -- cgit v1.2.3-70-g09d2