summary refs log tree commit diff
path: root/tests/boot-parameters.scm
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2022-03-21 21:38:19 -0400
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2022-03-21 21:38:19 -0400
commit49b350fafc2c3ea1db66461b73d4e304cd13ec92 (patch)
tree9b9b1a4a383b5175241ae6b91b83de0590f13983 /tests/boot-parameters.scm
parent03b5668a035ba96c9690476078c5ee1d5793f3e2 (diff)
parente584a093f943be216fdc93895281fde835836b8d (diff)
downloadguix-49b350fafc2c3ea1db66461b73d4e304cd13ec92.tar.gz
Merge branch 'master' into staging.
Diffstat (limited to 'tests/boot-parameters.scm')
-rw-r--r--tests/boot-parameters.scm23
1 files changed, 15 insertions, 8 deletions
diff --git a/tests/boot-parameters.scm b/tests/boot-parameters.scm
index b2799d0596..8e48e1775e 100644
--- a/tests/boot-parameters.scm
+++ b/tests/boot-parameters.scm
@@ -28,9 +28,11 @@
   #:use-module (gnu system)
   #:use-module (gnu system file-systems)
   #:use-module (gnu system uuid)
+  #:use-module ((guix diagnostics) #:select (formatted-message?))
   #:use-module (guix gexp)
   #:use-module (guix store)
   #:use-module (guix tests)
+  #:use-module (srfi srfi-34)
   #:use-module (srfi srfi-64)
   #:use-module (rnrs bytevectors))
 
@@ -101,7 +103,7 @@
 ;; Call read-boot-parameters with the desired string as input.
 (define* (test-read-boot-parameters
           #:key
-          (version 0)
+          (version %boot-parameters-version)
           (bootloader-name 'grub)
           (bootloader-menu-entries '())
           (label %default-label)
@@ -151,13 +153,18 @@
 
 ;; XXX: <warning: unrecognized boot parameters at '#f'>
 (test-assert "read, construction, mandatory fields"
-  (not (or (test-read-boot-parameters #:version #false)
-           (test-read-boot-parameters #:version 'false)
-           (test-read-boot-parameters #:version -1)
-           (test-read-boot-parameters #:version "0")
-           (test-read-boot-parameters #:root-device #false)
-           (test-read-boot-parameters #:kernel #false)
-           (test-read-boot-parameters #:label #false))))
+  (let-syntax ((test-read-boot-parameters
+                (syntax-rules ()
+                  ((_ args ...)
+                   (guard (c ((formatted-message? c) #f))
+                     (test-read-boot-parameters args ...))))))
+    (not (or (test-read-boot-parameters #:version #false)
+             (test-read-boot-parameters #:version 'false)
+             (test-read-boot-parameters #:version -1)
+             (test-read-boot-parameters #:version "0")
+             (test-read-boot-parameters #:root-device #false)
+             (test-read-boot-parameters #:kernel #false)
+             (test-read-boot-parameters #:label #false)))))
 
 (test-assert "read, construction, optional fields"
   (and (test-read-boot-parameters #:bootloader-name #false)