all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
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 2/3] tests: Check for service existence in MODIFY-SERVICES
Date: Tue, 16 May 2023 11:41:41 -0400	[thread overview]
Message-ID: <4de40059943bdd7fa6cc45a70a9cd1087edad57d.1684251702.git.bjc@spork.org> (raw)
In-Reply-To: <999ea3ff3ea32e4e1bb8b7b8abd4e0e29d1f2395.1684251702.git.bjc@spork.org>

* tests/services.scm ("modify-services: delete non-existing service")
("modify-services: change value for non-existing service"): New tests.
---
 tests/services.scm | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/tests/services.scm b/tests/services.scm
index 435f39e59b..5a9cd47489 100644
--- a/tests/services.scm
+++ b/tests/services.scm
@@ -319,6 +319,21 @@ (define-module (test-services)
                  (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)
   (let* ((t1 (service-type (name 't1)
@@ -336,4 +351,20 @@ (define-module (test-services)
                  (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)
-- 
2.40.1





       reply	other threads:[~2023-05-16 15:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <999ea3ff3ea32e4e1bb8b7b8abd4e0e29d1f2395.1684251702.git.bjc@spork.org>
2023-05-16 15:41 ` Brian Cully via Guix-patches via [this message]
2023-05-16 15:41 ` [bug#63538] [PATCH 3/3] gnu: services: Error in MODIFY-SERVICES when services don't exist Brian Cully via Guix-patches via
2023-05-26 22:27   ` [bug#63538] [PATCH] " Brian Cully via Guix-patches via

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=4de40059943bdd7fa6cc45a70a9cd1087edad57d.1684251702.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.