diff options
author | Ludovic Courtès <ludo@gnu.org> | 2017-01-04 16:16:17 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2017-01-04 16:18:53 +0100 |
commit | b96a0640a3ca128c0b9bf9acaef7b3b7a8bb1455 (patch) | |
tree | f228c2536475873ced944d315406ab869694a26e /tests | |
parent | a614ce389f473d7b2792176a1022ccb28bc8f587 (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')
-rw-r--r-- | tests/graph.scm | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/graph.scm b/tests/graph.scm index bc4d62fe50..6431c482f7 100644 --- a/tests/graph.scm +++ b/tests/graph.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2015, 2016 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org> ;;; ;;; This file is part of GNU Guix. ;;; @@ -32,6 +32,7 @@ #:use-module (gnu packages) #:use-module (gnu packages base) #:use-module (gnu packages guile) + #:use-module (gnu packages libunistring) #:use-module (gnu packages bootstrap) #:use-module (ice-9 match) #:use-module (srfi srfi-1) @@ -92,6 +93,17 @@ edges." (list p3 p3 p2) (list p2 p1 p1)))))))) +(test-assert "reverse package DAG" + (let-values (((backend nodes+edges) (make-recording-backend))) + (run-with-store %store + (export-graph (list libunistring) 'port + #:node-type %reverse-package-node-type + #:backend backend)) + ;; We should see nothing more than these 3 packages. + (let-values (((nodes edges) (nodes+edges))) + (and (member (package->tuple guile-2.0) nodes) + (->bool (member (edge->tuple libunistring guile-2.0) edges)))))) + (test-assert "bag-emerged DAG" (let-values (((backend nodes+edges) (make-recording-backend))) (let* ((o (dummy-origin (method (lambda _ |