diff options
author | Marius Bakke <marius@gnu.org> | 2022-02-13 14:24:53 +0100 |
---|---|---|
committer | Marius Bakke <marius@gnu.org> | 2022-02-13 14:24:53 +0100 |
commit | 76b6bbdf232b4b82cdd23cfe0d81331a4fd2edec (patch) | |
tree | 0e6a57ba08b9c6f9f5cbcdc5b5d9daeea91e428d /tests/graph.scm | |
parent | 1a5302435ff0d2822b823f5a6fe01faa7a85c629 (diff) | |
parent | e8af2ea63a7f497b8f8e19e206645109c0646e72 (diff) |
Merge branch 'master' into staging
Diffstat (limited to 'tests/graph.scm')
-rw-r--r-- | tests/graph.scm | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/graph.scm b/tests/graph.scm index fadac265f9..baa08a6be2 100644 --- a/tests/graph.scm +++ b/tests/graph.scm @@ -36,6 +36,7 @@ #:use-module (gnu packages libunistring) #:use-module (gnu packages bootstrap) #:use-module (ice-9 match) + #:use-module (ice-9 sandbox) #:use-module (srfi srfi-1) #:use-module (srfi srfi-11) #:use-module (srfi srfi-26) @@ -113,6 +114,33 @@ edges." (list p4 p4) (list p2 p3)))))))) +(test-assert "package DAG, oops it was a cycle" + (let-values (((backend nodes+edges) (make-recording-backend))) + (letrec ((p1 (dummy-package "p1" (inputs `(("p3" ,p3))))) + (p2 (dummy-package "p2" (inputs `(("p1" ,p1))))) + (p3 (dummy-package "p3" (inputs `(("p2" ,p2) ("p1", p1)))))) + (call-with-time-limit + 600 ;; If ever this test should fail, we still want it to terminate + (lambda () + (run-with-store %store + (export-graph (list p3) 'port + #:node-type %package-node-type + #:backend backend))) + (lambda () + (run-with-store %store + (export-graph + (list (dummy-package "timeout-reached")) + 'port + #:node-type %package-node-type + #:backend backend)))) + ;; We should see nothing more than these 3 packages. + (let-values (((nodes edges) (nodes+edges))) + (and (equal? nodes (map package->tuple (list p3 p2 p1))) + (equal? edges + (map edge->tuple + (list p3 p3 p2 p1) + (list p2 p1 p1 p3)))))))) + (test-assert "reverse package DAG" (let-values (((backend nodes+edges) (make-recording-backend))) (run-with-store %store |