guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02/02: tests: Add test for menu-entry roundtrips as sexps.


From: guix-commits
Subject: 02/02: tests: Add test for menu-entry roundtrips as sexps.
Date: Sun, 28 Aug 2022 17:44:37 -0400 (EDT)

mbakke pushed a commit to branch master
in repository guix.

commit 3294fa2ba451c7d5ef42a5d9fac780877f364bc7
Author: Josselin Poiret <dev@jpoiret.xyz>
AuthorDate: Sun Aug 21 10:41:16 2022 +0200

    tests: Add test for menu-entry roundtrips as sexps.
    
    * tests/boot-parameters.scm (%uuid-menu-entry,
    %file-system-label-menu-entry): New variables.
    ("menu-entry roundtrip, uuid", "menu-entry roundtrip,
    file-system-label"): New tests.
    
    Signed-off-by: Marius Bakke <marius@gnu.org>
---
 tests/boot-parameters.scm | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/tests/boot-parameters.scm b/tests/boot-parameters.scm
index 8e48e1775e..03a1d01aff 100644
--- a/tests/boot-parameters.scm
+++ b/tests/boot-parameters.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2019, 2020 Miguel Ángel Arruga Vivas <rosen644835@gmail.com>
+;;; Copyright © 2022 Josselin Poiret <dev@jpoiret.xyz>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -303,4 +304,26 @@
    (operating-system-boot-parameters %default-operating-system
                                      %default-root-device)))
 
+(define %uuid-menu-entry
+  (menu-entry
+   (label "test")
+   (device (uuid "6d5b13d4-6092-46d0-8be4-073dc07413cc"))
+   (linux "/boot/bzImage")
+   (initrd "/boot/initrd.cpio.gz")))
+
+(define %file-system-label-menu-entry
+  (menu-entry
+   (label "test")
+   (device (file-system-label "test-label"))
+   (linux "/boot/bzImage")
+   (initrd "/boot/initrd.cpio.gz")))
+
+(test-equal "menu-entry roundtrip, uuid"
+  %uuid-menu-entry
+  (sexp->menu-entry (menu-entry->sexp %uuid-menu-entry)))
+
+(test-equal "menu-entry roundtrip, file-system-label"
+  %file-system-label-menu-entry
+  (sexp->menu-entry (menu-entry->sexp %file-system-label-menu-entry)))
+
 (test-end "boot-parameters")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]