From: Brian Cully via Guix-patches via <guix-patches@gnu.org>
To: 63538@debbugs.gnu.org
Cc: Brian Cully <bjc@spork.org>
Subject: [bug#63538] [PATCH v2 1/3] tests: Add tests for MODIFY-SERVICES procedure
Date: Fri, 26 May 2023 18:30:15 -0400 [thread overview]
Message-ID: <d289f6bcc270806e2384f2443703ed135dc4c111.1685140217.git.bjc@spork.org> (raw)
In-Reply-To: <999ea3ff3ea32e4e1bb8b7b8abd4e0e29d1f2395.1684251578.git.bjc@spork.org>
* tests/services.scm ("modify-services: do nothing")
("modify-services: delete service")
("modify-services: change value"): New tests.
---
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 @@ (define-module (test-services)
((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)
base-commit: 1be6baed2b58a75868cdcc9f51b78624c2fefc4f
--
2.40.1
next prev parent reply other threads:[~2023-05-26 22:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-16 15:39 [bug#63538] [PATCH 1/3] tests: Add tests for MODIFY-SERVICES procedure Brian Cully via Guix-patches via
2023-05-26 22:30 ` Brian Cully via Guix-patches via [this message]
2023-05-26 22:30 ` [bug#63538] [PATCH v2 2/3] tests: Check for service existence in MODIFY-SERVICES Brian Cully via Guix-patches via
2023-05-26 22:30 ` [bug#63538] [PATCH v2 3/3] gnu: services: Error in MODIFY-SERVICES when services don't exist Brian Cully via Guix-patches via
2023-06-02 14:22 ` bug#63538: [PATCH] " Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d289f6bcc270806e2384f2443703ed135dc4c111.1685140217.git.bjc@spork.org \
--to=guix-patches@gnu.org \
--cc=63538@debbugs.gnu.org \
--cc=bjc@spork.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.