aboutsummaryrefslogtreecommitdiff
path: root/tests/derivations.scm
diff options
context:
space:
mode:
authorMark H Weaver <mhw@netris.org>2014-09-08 11:00:06 -0400
committerMark H Weaver <mhw@netris.org>2014-09-08 11:00:06 -0400
commite759c0a38c799f2d03b3454e9ca6acf2262dc957 (patch)
tree08f5a1414410bc6719205090ac07484b308ba918 /tests/derivations.scm
parent11459384968f654c42ad7dba4443dada35191f5b (diff)
parent4a4cbd0bdd2ad8c4f37c3ffdd69596ef1ef41d91 (diff)
downloadguix-e759c0a38c799f2d03b3454e9ca6acf2262dc957.tar.gz
guix-e759c0a38c799f2d03b3454e9ca6acf2262dc957.zip
Merge branch 'master' into core-updates
Diffstat (limited to 'tests/derivations.scm')
-rw-r--r--tests/derivations.scm22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/derivations.scm b/tests/derivations.scm
index 19bcebcb21..855b059d16 100644
--- a/tests/derivations.scm
+++ b/tests/derivations.scm
@@ -151,6 +151,28 @@
;; the contents.
(valid-path? %store (derivation->output-path drv)))))
+(test-assert "identical files are deduplicated"
+ (let* ((build1 (add-text-to-store %store "one.sh"
+ "echo hello, world > \"$out\"\n"
+ '()))
+ (build2 (add-text-to-store %store "two.sh"
+ "# Hey!\necho hello, world > \"$out\"\n"
+ '()))
+ (drv1 (derivation %store "foo"
+ %bash `(,build1)
+ #:inputs `((,%bash) (,build1))))
+ (drv2 (derivation %store "bar"
+ %bash `(,build2)
+ #:inputs `((,%bash) (,build2)))))
+ (and (build-derivations %store (list drv1 drv2))
+ (let ((file1 (derivation->output-path drv1))
+ (file2 (derivation->output-path drv2)))
+ (and (valid-path? %store file1) (valid-path? %store file2)
+ (string=? (call-with-input-file file1 get-string-all)
+ "hello, world\n")
+ (= (stat:ino (lstat file1))
+ (stat:ino (lstat file2))))))))
+
(test-assert "fixed-output-derivation?"
(let* ((builder (add-text-to-store %store "my-fixed-builder.sh"
"echo -n hello > $out" '()))