[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
09/17: tests: Add tests for MODIFY-SERVICES procedure
From: |
guix-commits |
Subject: |
09/17: tests: Add tests for MODIFY-SERVICES procedure |
Date: |
Fri, 2 Jun 2023 11:24:04 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit 09fcf261c1f66a07891ec2fe80f8652fd286bd3e
Author: Brian Cully <bjc@spork.org>
AuthorDate: Fri May 26 18:30:15 2023 -0400
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>
---
tests/services.scm | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 50 insertions(+)
diff --git a/tests/services.scm b/tests/services.scm
index 8e35758209..435f39e59b 100644
--- a/tests/services.scm
+++ b/tests/services.scm
@@ -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)
- 08/17: gnu: cuirass: Update to b825967., (continued)
- 08/17: gnu: cuirass: Update to b825967., guix-commits, 2023/06/02
- 01/17: ci: Reify the timestamps of evaluations., guix-commits, 2023/06/02
- 02/17: read-print: Add 'package/inherit' special form., guix-commits, 2023/06/02
- 04/17: gnu: cpp-mustache: Update to 5.0 to fix build., guix-commits, 2023/06/02
- 10/17: tests: Check for service existence in MODIFY-SERVICES, guix-commits, 2023/06/02
- 11/17: services: Error in MODIFY-SERVICES when services don't exist, guix-commits, 2023/06/02
- 13/17: gnu: Add ocaml-parmap., guix-commits, 2023/06/02
- 14/17: gnu: Add ocaml-stdcompat., guix-commits, 2023/06/02
- 06/17: gnu: python-ipython-documentation: Remove patches., guix-commits, 2023/06/02
- 07/17: gnu: python-ipython-documentation: Update dependencies., guix-commits, 2023/06/02
- 09/17: tests: Add tests for MODIFY-SERVICES procedure,
guix-commits <=
- 12/17: gnu: Add tmux-plugin-mem-cpu-load., guix-commits, 2023/06/02
- 15/17: gnu: Add ocaml-pyml., guix-commits, 2023/06/02
- 17/17: environment: Fix unbound-variable bug with '--symlink'., guix-commits, 2023/06/02
- 16/17: gnu: Add coccinelle., guix-commits, 2023/06/02