diff options
| author | David Elsing <david.elsing@posteo.net> | 2026-02-03 21:33:21 +0100 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2026-02-10 23:46:34 +0100 |
| commit | 96bd7262777f7f67cdd83c28171425f6bbcf3d50 (patch) | |
| tree | f345bfe791ee6c9cf00d2a639dee8bdfcc12ffcd /tests | |
| parent | 7d1b86859b84d8af0ad9a21648be431d169f216f (diff) | |
gexp: Add 'delayed-object'.
* guix/gexp.scm (<delayed-object>): New record type.
(delayed-object): New macro.
(delayed-object-compiler): New gexp compiler.
* tests/gexp.scm ("delayed-object"): New test.
* doc/guix.texi (G-Expressions): Document it.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/gexp.scm | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/gexp.scm b/tests/gexp.scm index 3622324a153..bba8c141f63 100644 --- a/tests/gexp.scm +++ b/tests/gexp.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2014-2025 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2021-2022 Maxime Devos <maximedevos@telenet.be> +;;; Copyright © 2026 David Elsing <david.elsing@posteo.net> ;;; ;;; This file is part of GNU Guix. ;;; @@ -518,6 +519,20 @@ (return (and (eq? drv0 result0) (eq? drv1 result1))))) +(test-assertm "delayed-object" + (let ((evaluated #f)) + (mlet* %store-monad ((drv (package->derivation coreutils)) + (obj -> (delayed-object + (begin + (set! evaluated #t) + coreutils))) + (first-evaluated -> evaluated) + (result (lower-object obj))) + (return (and (string=? (derivation-file-name drv) + (derivation-file-name result)) + (not first-evaluated) + evaluated))))) + (test-assert "with-parameters + file-append" (let* ((system (match (%current-system) ("aarch64-linux" "x86_64-linux") |
