From 0dbea56bbf28cd2671289791a10e419478de714c Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 15 Mar 2015 21:45:37 +0100 Subject: gexp: Export 'gexp-input' constructor. * guix/gexp.scm ()[gexp-input]: Rename to... [%gexp-input]: ... this. Adjust callers accordingly. (gexp-input): New procedure. (gexp-inputs)[add-reference-inputs]: When the input is a list, check whether each item is already 'gexp-input?' and to not rewrap those. (gexp-outputs)[add-reference-output]: Likewise. (gexp->sexp): Likewise. * tests/gexp.scm ("input list splicing + gexp-input + ungexp-native-splicing"): New test. --- tests/gexp.scm | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests') diff --git a/tests/gexp.scm b/tests/gexp.scm index ac2842d287..1e27407926 100644 --- a/tests/gexp.scm +++ b/tests/gexp.scm @@ -219,6 +219,16 @@ (equal? (gexp->sexp* exp) ;native (gexp->sexp* exp "mips64el-linux"))))) +(test-assert "input list splicing + gexp-input + ungexp-native-splicing" + (let* ((inputs (list (gexp-input glibc "debug") %bootstrap-guile)) + (exp (gexp (list (ungexp-native-splicing (cons (+ 2 3) inputs)))))) + (and (lset= equal? + `((,glibc "debug") (,%bootstrap-guile "out")) + (gexp-native-inputs exp)) + (null? (gexp-inputs exp)) + (equal? (gexp->sexp* exp) ;native + (gexp->sexp* exp "mips64el-linux"))))) + (test-equal "output list" 2 (let ((exp (gexp (begin (mkdir (ungexp output)) -- cgit v1.2.3