mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
gexp: ‘with-parameters’ accepts plain store items in its body.
* guix/gexp.scm (compile-parameterized): Return ‘obj’ as-is when it’s not a struct. * tests/gexp.scm ("with-parameters + store item"): New test. Change-Id: I5b5348b98bce923d07f6fa39b2f0948723011db8
This commit is contained in:
parent
72de3752f0
commit
3ad2d21671
2 changed files with 24 additions and 7 deletions
|
@ -1,5 +1,5 @@
|
|||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2014-2024 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2014-2025 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2021-2022 Maxime Devos <maximedevos@telenet.be>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
|
@ -467,6 +467,15 @@
|
|||
(string=? result
|
||||
(string-append (derivation->output-path drv)
|
||||
"/bin/touch"))))))
|
||||
|
||||
(test-assert "with-parameters + store item"
|
||||
(let* ((file (add-text-to-store %store "hello.txt" "Hello, world!"))
|
||||
(obj (with-parameters ((%current-system "aarch64-linux"))
|
||||
file))
|
||||
(lowered (run-with-store %store
|
||||
(lower-object obj))))
|
||||
(string=? lowered file)))
|
||||
|
||||
(test-equal "let-system"
|
||||
(list `(begin ,(%current-system) #t) '(system-binding)
|
||||
'low '() '())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue