summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-03-10 23:02:43 +0100
committerLudovic Courtès <ludo@gnu.org>2014-03-10 23:43:31 +0100
commit58cbbe4b5562ed8be5c7c6fbdf2b2d8384a5dc8a (patch)
tree59cf8e03aff703582c6cb771bc4c32e09cbc7d46 /tests
parent220193ad038b1aabb776d032526ad4546f76447e (diff)
tests: 'topologically-sorted' test handles different references orders.
* tests/store.scm ("topologically-sorted, more difficult"): Arrange to handle a different ordering of (references %store y).
Diffstat (limited to 'tests')
-rw-r--r--tests/store.scm15
1 files changed, 12 insertions, 3 deletions
diff --git a/tests/store.scm b/tests/store.scm
index cc76ea5500..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" '()))