diff options
author | Ludovic Courtès <ludo@gnu.org> | 2014-05-01 16:15:00 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2014-05-01 22:31:36 +0200 |
commit | 79c0c8cdf74cc0587187aa8f25af29b21fe91ba2 (patch) | |
tree | cc9f5e66672c7e1b35f0a6804e1420277549813b /tests | |
parent | 696893801c9d4b83adc9a15ce60103142e7c1a79 (diff) | |
download | guix-79c0c8cdf74cc0587187aa8f25af29b21fe91ba2.tar.gz |
gexp: Add support for 'origin?' objects in 'ungexp' forms.
* guix/gexp.scm (lower-inputs, gexp-inputs, gexp->sexp, canonicalize-reference): Add 'origin?' case. * guix/monads.scm (origin->derivation): New procedure. * tests/gexp.scm ("one input origin"): New test.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/gexp.scm | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/tests/gexp.scm b/tests/gexp.scm index 3da5b82e4c..21606b510b 100644 --- a/tests/gexp.scm +++ b/tests/gexp.scm @@ -21,8 +21,7 @@ #:use-module (guix monads) #:use-module (guix gexp) #:use-module (guix derivations) - #:use-module ((guix packages) - #:select (package-derivation %current-system)) + #:use-module (guix packages) #:use-module (gnu packages) #:use-module (gnu packages base) #:use-module (gnu packages bootstrap) @@ -83,6 +82,17 @@ (package-derivation %store coreutils))) (gexp->sexp* exp))))) +(test-assert "one input origin" + (let ((exp (gexp (display (ungexp (package-source coreutils)))))) + (and (gexp? exp) + (match (gexp-inputs exp) + (((o "out")) + (eq? o (package-source coreutils)))) + (equal? `(display ,(derivation->output-path + (package-source-derivation + %store (package-source coreutils)))) + (gexp->sexp* exp))))) + (test-assert "same input twice" (let ((exp (gexp (begin (display (ungexp coreutils)) |