diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2025-01-28 14:51:00 +0100 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2025-01-28 14:56:14 +0100 |
| commit | 3ad2d21671ad56e61c779da253d4396435658198 (patch) | |
| tree | 3e266e37816a326e2e1643044a691edddf115897 /tests/gexp.scm | |
| parent | 72de3752f06de2a64fe8135a0839ca25534b326a (diff) | |
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
Diffstat (limited to 'tests/gexp.scm')
| -rw-r--r-- | tests/gexp.scm | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/gexp.scm b/tests/gexp.scm index e066076c5c0..e870f6cb1b9 100644 --- a/tests/gexp.scm +++ b/tests/gexp.scm | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2014-2024 Ludovic Courtès <ludo@gnu.org> | 2 | ;;; Copyright © 2014-2025 Ludovic Courtès <ludo@gnu.org> |
| 3 | ;;; Copyright © 2021-2022 Maxime Devos <maximedevos@telenet.be> | 3 | ;;; Copyright © 2021-2022 Maxime Devos <maximedevos@telenet.be> |
| 4 | ;;; | 4 | ;;; |
| 5 | ;;; This file is part of GNU Guix. | 5 | ;;; This file is part of GNU Guix. |
| @@ -467,6 +467,15 @@ | |||
| 467 | (string=? result | 467 | (string=? result |
| 468 | (string-append (derivation->output-path drv) | 468 | (string-append (derivation->output-path drv) |
| 469 | "/bin/touch")))))) | 469 | "/bin/touch")))))) |
| 470 | |||
| 471 | (test-assert "with-parameters + store item" | ||
| 472 | (let* ((file (add-text-to-store %store "hello.txt" "Hello, world!")) | ||
| 473 | (obj (with-parameters ((%current-system "aarch64-linux")) | ||
| 474 | file)) | ||
| 475 | (lowered (run-with-store %store | ||
| 476 | (lower-object obj)))) | ||
| 477 | (string=? lowered file))) | ||
| 478 | |||
| 470 | (test-equal "let-system" | 479 | (test-equal "let-system" |
| 471 | (list `(begin ,(%current-system) #t) '(system-binding) | 480 | (list `(begin ,(%current-system) #t) '(system-binding) |
| 472 | 'low '() '()) | 481 | 'low '() '()) |
