fa339222d80ebf8d01c41176560fd6fea061818f
[8sync.git] / tests / test-actors.scm
1 (define-module (tests test-actors)
2   #:use-module (srfi srfi-64)
3   #:use-module (8sync systems actors)
4   #:use-module (tests utils))
5
6 (test-begin "test-actors")
7
8
9 ;;; Actor utilities
10 ;;; ===============
11
12 ;;; Message tests
13 ;;; =============
14
15 (let ((monkey-message
16        (make-message 'id 'to 'from 'action
17                      '((monkey . banana)))))
18   ;; A key we have
19   (test-equal (message-ref monkey-message 'monkey)
20     'banana)
21
22   ;; A key we don't have
23   (test-equal (message-ref monkey-message 'coo-coo)
24     #f)
25
26   ;; A key we don't have, with a default set
27   (test-equal (message-ref monkey-message 'coo-coo 'danger-danger)
28     'danger-danger))
29
30
31 (test-end "test-agenda")
32 (test-exit)