diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2015-10-14 14:58:25 +0200 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2015-10-14 21:39:05 +0200 |
| commit | 5152d13b51a6418db52ce6dd572cc412e5addf44 (patch) | |
| tree | f8578b3c70c33ea965ba6709be5940613e705abb /tests | |
| parent | 87cd0dba2fd221ada9f12ea1cb3d3d151834f498 (diff) | |
services: Export 'service-back-edges'.
* gnu/services.scm: Export 'service-back-edges' and <service-type>
accessors.
* tests/services.scm ("service-back-edges"): New test.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/services.scm | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/services.scm b/tests/services.scm index b4e2cb0b305..ae2d999feee 100644 --- a/tests/services.scm +++ b/tests/services.scm | |||
| @@ -25,6 +25,25 @@ | |||
| 25 | 25 | ||
| 26 | (test-begin "services") | 26 | (test-begin "services") |
| 27 | 27 | ||
| 28 | (test-assert "service-back-edges" | ||
| 29 | (let* ((t1 (service-type (name 't1) (extensions '()) | ||
| 30 | (compose +) (extend *))) | ||
| 31 | (t2 (service-type (name 't2) | ||
| 32 | (extensions | ||
| 33 | (list (service-extension t1 (const '())))) | ||
| 34 | (compose +) (extend *))) | ||
| 35 | (t3 (service-type (name 't3) | ||
| 36 | (extensions | ||
| 37 | (list (service-extension t2 identity) | ||
| 38 | (service-extension t1 list))))) | ||
| 39 | (s1 (service t1 #t)) | ||
| 40 | (s2 (service t2 #t)) | ||
| 41 | (s3 (service t3 #t)) | ||
| 42 | (e (service-back-edges (list s1 s2 s3)))) | ||
| 43 | (and (lset= eq? (e s1) (list s2 s3)) | ||
| 44 | (lset= eq? (e s2) (list s3)) | ||
| 45 | (null? (e s3))))) | ||
| 46 | |||
| 28 | (test-equal "fold-services" | 47 | (test-equal "fold-services" |
| 29 | ;; Make sure 'fold-services' returns the right result. The numbers come | 48 | ;; Make sure 'fold-services' returns the right result. The numbers come |
| 30 | ;; from services of type T3; 'xyz 60' comes from the service of type T2, | 49 | ;; from services of type T3; 'xyz 60' comes from the service of type T2, |
