[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
10/17: tests: Check for service existence in MODIFY-SERVICES
From: |
guix-commits |
Subject: |
10/17: tests: Check for service existence in MODIFY-SERVICES |
Date: |
Fri, 2 Jun 2023 11:24:04 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit ae707b62e71b1fae054eb422412384bcc8d39fa9
Author: Brian Cully <bjc@spork.org>
AuthorDate: Fri May 26 18:30:16 2023 -0400
tests: Check for service existence in MODIFY-SERVICES
* tests/services.scm ("modify-services: delete non-existing service")
("modify-services: change value for non-existing service"): New tests.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
---
tests/services.scm | 37 +++++++++++++++++++++++++++++++++++--
1 file changed, 35 insertions(+), 2 deletions(-)
diff --git a/tests/services.scm b/tests/services.scm
index 435f39e59b..8cdb1b2a31 100644
--- a/tests/services.scm
+++ b/tests/services.scm
@@ -303,7 +303,7 @@
<)))
(test-equal "modify-services: delete service"
- '(1 3)
+ '(1)
(let* ((t1 (service-type (name 't1)
(extensions '())
(description "")))
@@ -316,11 +316,27 @@
(services (list (service t1 1) (service t2 2) (service t3 3))))
(sort (map service-value
(modify-services services
+ (delete t3)
(delete t2)))
<)))
+(test-error "modify-services: delete non-existing service"
+ #t
+ (let* ((t1 (service-type (name 't1)
+ (extensions '())
+ (description "")))
+ (t2 (service-type (name 't2)
+ (extensions '())
+ (description "")))
+ (t3 (service-type (name 't2)
+ (extensions '())
+ (description "")))
+ (services (list (service t1 1) (service t2 2))))
+ (modify-services services
+ (delete t3))))
+
(test-equal "modify-services: change value"
- '(1 2 33)
+ '(2 11 33)
(let* ((t1 (service-type (name 't1)
(extensions '())
(description "")))
@@ -333,7 +349,24 @@
(services (list (service t1 1) (service t2 2) (service t3 3))))
(sort (map service-value
(modify-services services
+ (t1 value => 11)
(t3 value => 33)))
<)))
+(test-error "modify-services: change value for non-existing service"
+ #t
+ (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 t3 3))))
+ (map service-value
+ (modify-services services
+ (t2 value => 22)))))
+
(test-end)
- branch master updated (a7d9cd742c -> 69dfdb7bd1), guix-commits, 2023/06/02
- 05/17: gnu: python-docrepr: Fix tests., guix-commits, 2023/06/02
- 03/17: gnu: gcc-boot0: Do not use 'coreutils-boot0' on GNU/Hurd., guix-commits, 2023/06/02
- 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 <=
- 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, 2023/06/02
- 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