summaryrefslogtreecommitdiff
path: root/tests/graph.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2017-01-04 16:16:17 +0100
committerLudovic Courtès <ludo@gnu.org>2017-01-04 16:18:53 +0100
commitb96a0640a3ca128c0b9bf9acaef7b3b7a8bb1455 (patch)
treef228c2536475873ced944d315406ab869694a26e /tests/graph.scm
parenta614ce389f473d7b2792176a1022ccb28bc8f587 (diff)
graph: Add '%reverse-package-node-type'.
* guix/scripts/graph.scm (%reverse-package-node-type): New variable. (%node-types): Add it. * tests/graph.scm ("reverse package DAG"): New test. * doc/guix.texi (Invoking guix refresh): Add cross-reference to "Invoking guix graph". (Invoking guix graph): Document 'reverse-package'.
Diffstat (limited to 'tests/graph.scm')
-rw-r--r--tests/graph.scm14
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/graph.scm b/tests/graph.scm
index bc4d62fe503..6431c482f7a 100644
--- a/tests/graph.scm
+++ b/tests/graph.scm
@@ -1,5 +1,5 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2015, 2016 Ludovic Courtès <ludo@gnu.org> 2;;; Copyright © 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
3;;; 3;;;
4;;; This file is part of GNU Guix. 4;;; This file is part of GNU Guix.
5;;; 5;;;
@@ -32,6 +32,7 @@
32 #:use-module (gnu packages) 32 #:use-module (gnu packages)
33 #:use-module (gnu packages base) 33 #:use-module (gnu packages base)
34 #:use-module (gnu packages guile) 34 #:use-module (gnu packages guile)
35 #:use-module (gnu packages libunistring)
35 #:use-module (gnu packages bootstrap) 36 #:use-module (gnu packages bootstrap)
36 #:use-module (ice-9 match) 37 #:use-module (ice-9 match)
37 #:use-module (srfi srfi-1) 38 #:use-module (srfi srfi-1)
@@ -92,6 +93,17 @@ edges."
92 (list p3 p3 p2) 93 (list p3 p3 p2)
93 (list p2 p1 p1)))))))) 94 (list p2 p1 p1))))))))
94 95
96(test-assert "reverse package DAG"
97 (let-values (((backend nodes+edges) (make-recording-backend)))
98 (run-with-store %store
99 (export-graph (list libunistring) 'port
100 #:node-type %reverse-package-node-type
101 #:backend backend))
102 ;; We should see nothing more than these 3 packages.
103 (let-values (((nodes edges) (nodes+edges)))
104 (and (member (package->tuple guile-2.0) nodes)
105 (->bool (member (edge->tuple libunistring guile-2.0) edges))))))
106
95(test-assert "bag-emerged DAG" 107(test-assert "bag-emerged DAG"
96 (let-values (((backend nodes+edges) (make-recording-backend))) 108 (let-values (((backend nodes+edges) (make-recording-backend)))
97 (let* ((o (dummy-origin (method (lambda _ 109 (let* ((o (dummy-origin (method (lambda _