summary refs log tree commit diff
path: root/tests/services.scm
diff options
context:
space:
mode:
Diffstat (limited to 'tests/services.scm')
-rw-r--r--tests/services.scm37
1 files changed, 19 insertions, 18 deletions
diff --git a/tests/services.scm b/tests/services.scm
index 8cdb1b2a31..20ff4d317e 100644
--- a/tests/services.scm
+++ b/tests/services.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2015-2019, 2022 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2015-2019, 2022, 2023 Ludovic Courtès <ludo@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -287,7 +287,7 @@
          (x x))))
 
 (test-equal "modify-services: do nothing"
-  '(1 2 3)
+  '(1 2 3)                              ;note: service order must be preserved
   (let* ((t1 (service-type (name 't1)
                            (extensions '())
                            (description "")))
@@ -298,12 +298,11 @@
                            (extensions '())
                            (description "")))
          (services (list (service t1 1) (service t2 2) (service t3 3))))
-    (sort (map service-value
-               (modify-services services))
-          <)))
+    (map service-value
+         (modify-services services))))
 
 (test-equal "modify-services: delete service"
-  '(1)
+  '(1 4)                                ;note: service order must be preserved
   (let* ((t1 (service-type (name 't1)
                            (extensions '())
                            (description "")))
@@ -313,12 +312,15 @@
          (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 t3)
-                 (delete t2)))
-          <)))
+         (t4 (service-type (name 't4)
+                           (extensions '())
+                           (description "")))
+         (services (list (service t1 1) (service t2 2)
+                         (service t3 3) (service t4 4))))
+    (map service-value
+         (modify-services services
+           (delete t3)
+           (delete t2)))))
 
 (test-error "modify-services: delete non-existing service"
   #t
@@ -336,7 +338,7 @@
       (delete t3))))
 
 (test-equal "modify-services: change value"
-  '(2 11 33)
+  '(11 2 33)                            ;note: service order must be preserved
   (let* ((t1 (service-type (name 't1)
                            (extensions '())
                            (description "")))
@@ -347,11 +349,10 @@
                            (extensions '())
                            (description "")))
          (services (list (service t1 1) (service t2 2) (service t3 3))))
-    (sort (map service-value
-               (modify-services services
-                 (t1 value => 11)
-                 (t3 value => 33)))
-          <)))
+    (map service-value
+         (modify-services services
+           (t1 value => 11)
+           (t3 value => 33)))))
 
 (test-error "modify-services: change value for non-existing service"
   #t