aboutsummaryrefslogtreecommitdiff
path: root/tests/services.scm
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2018-09-09 17:40:35 +0200
committerMarius Bakke <mbakke@fastmail.com>2018-09-09 17:40:35 +0200
commit0aeb13485055975d71ec8283040f007c79599bba (patch)
treea06139136c809b00d166d6d66bdf757f20566704 /tests/services.scm
parentb03f270e3d5ab5315b50ef3ebac35735cc28d4a2 (diff)
parent0084744b3af0a6f8e125120143f57567902339a8 (diff)
downloadpatches-0aeb13485055975d71ec8283040f007c79599bba.tar
patches-0aeb13485055975d71ec8283040f007c79599bba.tar.gz
Merge branch 'master' into core-updates
Diffstat (limited to 'tests/services.scm')
-rw-r--r--tests/services.scm25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/services.scm b/tests/services.scm
index b146a0dec2..1ad577e601 100644
--- a/tests/services.scm
+++ b/tests/services.scm
@@ -138,6 +138,31 @@
(equal? (list s1 s2)
(instantiate-missing-services (list s1 s2))))))
+(test-assert "instantiate-missing-services, indirect"
+ (let* ((t1 (service-type (name 't1) (extensions '())
+ (default-value 'dflt)
+ (compose concatenate)
+ (extend cons)))
+ (t2 (service-type (name 't2) (extensions '())
+ (default-value 'dflt2)
+ (compose concatenate)
+ (extend cons)
+ (extensions
+ (list (service-extension t1 list)))))
+ (t3 (service-type (name 't3)
+ (extensions
+ (list (service-extension t2 list)))))
+ (s1 (service t1))
+ (s2 (service t2))
+ (s3 (service t3 42))
+ (== (cut lset= equal? <...>)))
+ (and (== (list s1 s2 s3)
+ (instantiate-missing-services (list s3)))
+ (== (list s1 s2 s3)
+ (instantiate-missing-services (list s1 s3)))
+ (== (list s1 s2 s3)
+ (instantiate-missing-services (list s2 s3))))))
+
(test-assert "instantiate-missing-services, no default value"
(let* ((t1 (service-type (name 't1) (extensions '())))
(t2 (service-type (name 't2)