aboutsummaryrefslogtreecommitdiff
path: root/tests/store.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-03-10 23:54:17 +0100
committerLudovic Courtès <ludo@gnu.org>2014-03-10 23:54:17 +0100
commite06f7865e2630494a522ac32b9c0a0311be3e1e2 (patch)
tree1a547ad3a2e4c1b98a67845a9de0dfc798227b5f /tests/store.scm
parentff3c0c1b805453990a42f690f148b41b9dff382a (diff)
parentc9c88118a12b0e22b7369b1dc6b0e2f9db894986 (diff)
downloadpatches-e06f7865e2630494a522ac32b9c0a0311be3e1e2.tar
patches-e06f7865e2630494a522ac32b9c0a0311be3e1e2.tar.gz
Merge branch 'master' into core-updates
Diffstat (limited to 'tests/store.scm')
-rw-r--r--tests/store.scm22
1 files changed, 17 insertions, 5 deletions
diff --git a/tests/store.scm b/tests/store.scm
index 7b0f3249d2..8a25c7353b 100644
--- a/tests/store.scm
+++ b/tests/store.scm
@@ -190,9 +190,18 @@
(s1 (topologically-sorted %store (list y)))
(s2 (topologically-sorted %store (list c y)))
(s3 (topologically-sorted %store (cons y (references %store y)))))
- (and (equal? s1 (list w x a b c d y))
- (equal? s2 (list a b c w x d y))
- (lset= string=? s1 s3))))
+ ;; The order in which 'references' returns the references of Y is
+ ;; unspecified, so accommodate.
+ (let* ((x-then-d? (equal? (references %store y) (list x d))))
+ (and (equal? s1
+ (if x-then-d?
+ (list w x a b c d y)
+ (list a b c d w x y)))
+ (equal? s2
+ (if x-then-d?
+ (list a b c w x d y)
+ (list a b c d w x y)))
+ (lset= string=? s1 s3)))))
(test-assert "log-file, derivation"
(let* ((b (add-text-to-store %store "build" "echo $foo > $out" '()))
@@ -399,7 +408,9 @@ Deriver: ~a~%"
files)))))))
(test-assert "export/import paths, ensure topological order"
- (let* ((file1 (add-text-to-store %store "foo" (random-text)))
+ (let* ((file0 (add-text-to-store %store "baz" (random-text)))
+ (file1 (add-text-to-store %store "foo" (random-text)
+ (list file0)))
(file2 (add-text-to-store %store "bar" (random-text)
(list file1)))
(files (list file1 file2))
@@ -412,9 +423,10 @@ Deriver: ~a~%"
(bytevector=? dump1 dump2)
(let* ((source (open-bytevector-input-port dump1))
(imported (import-paths %store source)))
+ ;; DUMP1 should contain exactly FILE1 and FILE2, not FILE0.
(and (equal? imported (list file1 file2))
(every file-exists? files)
- (null? (references %store file1))
+ (equal? (list file0) (references %store file1))
(equal? (list file1) (references %store file2)))))))
(test-assert "import corrupt path"