summary refs log tree commit diff
path: root/tests/packages.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2019-01-25 10:05:31 +0100
committerLudovic Courtès <ludo@gnu.org>2019-01-25 14:06:37 +0100
commit3e223a22a70138b8c57e742ad8ec737131249820 (patch)
tree63c1ec9cf5e89a487b473b5cb578039d580f9917 /tests/packages.scm
parentc6e33df90f2c10046bee1f0bb2e4eb7dc1688d20 (diff)
downloadguix-3e223a22a70138b8c57e742ad8ec737131249820.tar.gz
packages: Add 'package-closure'.
* guix/packages.scm (package-closure): New procedure.
* tests/packages.scm ("package-closure"): New test.
Diffstat (limited to 'tests/packages.scm')
-rw-r--r--tests/packages.scm23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/packages.scm b/tests/packages.scm
index 29e5e4103c..e5704ae4b9 100644
--- a/tests/packages.scm
+++ b/tests/packages.scm
@@ -249,6 +249,28 @@
           (package-transitive-supported-systems d)
           (package-transitive-supported-systems e))))
 
+(test-assert "package-closure"
+  (let-syntax ((dummy-package/no-implicit
+                (syntax-rules ()
+                  ((_ name rest ...)
+                   (package
+                     (inherit (dummy-package name rest ...))
+                     (build-system trivial-build-system))))))
+    (let* ((a (dummy-package/no-implicit "a"))
+           (b (dummy-package/no-implicit "b"
+                (propagated-inputs `(("a" ,a)))))
+           (c (dummy-package/no-implicit "c"
+                (inputs `(("a" ,a)))))
+           (d (dummy-package/no-implicit "d"
+                (native-inputs `(("b" ,b)))))
+           (e (dummy-package/no-implicit "e"
+                (inputs `(("c" ,c) ("d" ,d))))))
+      (lset= eq?
+             (list a b c d e)
+             (package-closure (list e))
+             (package-closure (list e d))
+             (package-closure (list e c b))))))
+
 (test-equal "origin-actual-file-name"
   "foo-1.tar.gz"
   (let ((o (dummy-origin (uri "http://www.example.com/foo-1.tar.gz"))))
@@ -1180,4 +1202,5 @@
 
 ;;; Local Variables:
 ;;; eval: (put 'dummy-package 'scheme-indent-function 1)
+;;; eval: (put 'dummy-package/no-implicit 'scheme-indent-function 1)
 ;;; End: