summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-12-13 21:41:52 +0100
committerLudovic Courtès <ludo@gnu.org>2015-12-13 21:41:52 +0100
commit88d5858f55ea824cd9f09d8d3481a9a85aea3fa8 (patch)
treed828dabe77bbf96513c803db677086eb32acfecb /tests
parent20464dde13dc540951edc035d1af5d9fd756f2d1 (diff)
downloadguix-88d5858f55ea824cd9f09d8d3481a9a85aea3fa8.tar.gz
graph: Add synthetic test.
* tests/graph.scm ("node-transitive-edges, no duplicates"): New test.
Diffstat (limited to 'tests')
-rw-r--r--tests/graph.scm11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/graph.scm b/tests/graph.scm
index ad8aea0ada..04c6e74279 100644
--- a/tests/graph.scm
+++ b/tests/graph.scm
@@ -250,6 +250,17 @@ edges."
                                        (bootstrap? package)))
                                  diff))))))))
 
+(test-assert "node-transitive-edges, no duplicates"
+  (run-with-store %store
+    (let* ((p0  (dummy-package "p0"))
+           (p1a (dummy-package "p1a" (inputs `(("p0" ,p0)))))
+           (p1b (dummy-package "p1b" (inputs `(("p0" ,p0)))))
+           (p2  (dummy-package "p2" (inputs `(("p1a" ,p1a) ("p1b" ,p1b))))))
+      (mlet %store-monad ((edges (node-edges %package-node-type
+                                             (list p2 p1a p1b p0))))
+        (return (lset= eq? (node-transitive-edges (list p2) edges)
+                       (list p1a p1b p0)))))))
+
 (test-end "graph")