summary refs log tree commit diff
path: root/tests/gexp.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2017-07-17 23:21:55 +0200
committerLudovic Courtès <ludo@gnu.org>2017-07-17 23:41:36 +0200
commit578dfbe07bcd1bdef9129c6ce8529332a0abcba6 (patch)
tree668703deb222e43c80fb85590097b6ad80591c25 /tests/gexp.scm
parent1cbcbc8600789a29c98788bab4633d00ec376554 (diff)
downloadguix-578dfbe07bcd1bdef9129c6ce8529332a0abcba6.tar.gz
gexp: 'ungexp-splicing' properly accounts for nested native inputs.
Previously, (gexp-native-inputs #~#$@(list #~#+foo)) would return '().

This is a followup to 5b14a7902c58d9fb7923f9e16871f549fbe59b6e.

* guix/gexp.scm (gexp-inputs)[add-reference-inputs]: In the list case,
remove 'if' around 'fold-right'.  In 'map' lambda, always inherit N?.
* tests/gexp.scm ("gexp list splicing + ungexp-splicing"): New test.
Diffstat (limited to 'tests/gexp.scm')
-rw-r--r--tests/gexp.scm8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/gexp.scm b/tests/gexp.scm
index cf88a9db80..5873abdd41 100644
--- a/tests/gexp.scm
+++ b/tests/gexp.scm
@@ -355,6 +355,14 @@
          (equal? (gexp->sexp* exp)                ;native
                  (gexp->sexp* exp "mips64el-linux")))))
 
+(test-assert "gexp list splicing + ungexp-splicing"
+  (let* ((inner (gexp (ungexp-native glibc)))
+         (exp   (gexp (list (ungexp-splicing (list inner))))))
+    (and (equal? `((,glibc "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))