summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2017-01-01 22:22:14 +0100
committerLudovic Courtès <ludo@gnu.org>2017-01-01 23:30:30 +0100
commit5e2e4a51f93f98c35824e4a7f5a88274d1551b4c (patch)
treea177456b845a28b17fdb62f5f4babf7ab10d657e /tests
parent4a6e889feba7bb382bb9e356d15e8260a256ced4 (diff)
downloadguix-5e2e4a51f93f98c35824e4a7f5a88274d1551b4c.tar.gz
gexp: Support 'ungexp' forms in improper lists.
* guix/gexp.scm (gexp)[collect-escapes, substitute-references]: Replace
the (exp0 exp ...) patterns with (exp0 . exp) to match improper lists.
Adjust clause bodies accordingly.
* tests/gexp.scm ("one input package, dotted list"): New test.
Diffstat (limited to 'tests')
-rw-r--r--tests/gexp.scm12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/gexp.scm b/tests/gexp.scm
index 797d5fa457..baf78837ae 100644
--- a/tests/gexp.scm
+++ b/tests/gexp.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -92,6 +92,16 @@
                              (package-derivation %store coreutils)))
                  (gexp->sexp* exp)))))
 
+(test-assert "one input package, dotted list"
+  (let ((exp (gexp (coreutils . (ungexp coreutils)))))
+    (and (gexp? exp)
+         (match (gexp-inputs exp)
+           (((p "out"))
+            (eq? p coreutils)))
+         (equal? `(coreutils . ,(derivation->output-path
+                                 (package-derivation %store coreutils)))
+                 (gexp->sexp* exp)))))
+
 (test-assert "one input origin"
   (let ((exp (gexp (display (ungexp (package-source coreutils))))))
     (and (gexp? exp)