From 79c0c8cdf74cc0587187aa8f25af29b21fe91ba2 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 1 May 2014 16:15:00 +0200 Subject: 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. --- tests/gexp.scm | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'tests') 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)) -- cgit 1.4.1