me
/
guix
Archived
1
0
Fork 0

tests: Add tests for MODIFY-SERVICES procedure

* tests/services.scm ("modify-services: do nothing")
("modify-services: delete service")
("modify-services: change value"): New tests.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
master
Brian Cully 2023-05-26 18:30:15 -04:00 committed by Ludovic Courtès
parent decf5fed65
commit 09fcf261c1
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 50 additions and 0 deletions

View File

@ -286,4 +286,54 @@
((one) one)
(x x))))
(test-equal "modify-services: do nothing"
'(1 2 3)
(let* ((t1 (service-type (name 't1)
(extensions '())
(description "")))
(t2 (service-type (name 't2)
(extensions '())
(description "")))
(t3 (service-type (name 't3)
(extensions '())
(description "")))
(services (list (service t1 1) (service t2 2) (service t3 3))))
(sort (map service-value
(modify-services services))
<)))
(test-equal "modify-services: delete service"
'(1 3)
(let* ((t1 (service-type (name 't1)
(extensions '())
(description "")))
(t2 (service-type (name 't2)
(extensions '())
(description "")))
(t3 (service-type (name 't3)
(extensions '())
(description "")))
(services (list (service t1 1) (service t2 2) (service t3 3))))
(sort (map service-value
(modify-services services
(delete t2)))
<)))
(test-equal "modify-services: change value"
'(1 2 33)
(let* ((t1 (service-type (name 't1)
(extensions '())
(description "")))
(t2 (service-type (name 't2)
(extensions '())
(description "")))
(t3 (service-type (name 't3)
(extensions '())
(description "")))
(services (list (service t1 1) (service t2 2) (service t3 3))))
(sort (map service-value
(modify-services services
(t3 value => 33)))
<)))
(test-end)