diff options
author | Ludovic Courtès <ludo@gnu.org> | 2015-03-15 21:45:37 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2015-03-17 22:25:54 +0100 |
commit | 0dbea56bbf28cd2671289791a10e419478de714c (patch) | |
tree | eef5d926f1ba195d22b9ebcd3173f3d91cf90136 /tests/gexp.scm | |
parent | e39d1461078837a13d50f48eb2b8dff2bdbd9856 (diff) | |
download | patches-0dbea56bbf28cd2671289791a10e419478de714c.tar patches-0dbea56bbf28cd2671289791a10e419478de714c.tar.gz |
gexp: Export 'gexp-input' constructor.
* guix/gexp.scm (<gexp-input>)[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.
Diffstat (limited to 'tests/gexp.scm')
-rw-r--r-- | tests/gexp.scm | 10 |
1 files changed, 10 insertions, 0 deletions
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)) |