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 23:39:43 -0400
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2022-03-21 23:39:43 -0400
commita9429c8f2207841c649438187d6e19046d323a16 (patch)
treea06e4b8a87b6a42742cf6750276746a10b6c2139 /tests/boot-parameters.scm
parentf0136b36ae8c1e9c174043bd50e0e24413c0f345 (diff)
parent49b350fafc2c3ea1db66461b73d4e304cd13ec92 (diff)
downloadguix-a9429c8f2207841c649438187d6e19046d323a16.tar.gz
Merge branch 'staging' into core-updates.
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)