summary refs log tree commit diff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2012-06-12 00:19:04 +0200
committerLudovic Courtès <ludo@gnu.org>2012-06-12 00:19:04 +0200
commitd1b1c4249a1747262e48d15512ee5435da068182 (patch)
treefa64b5ef807e7c33084e79f45e15c044e669efd8
parent3eb982377e32018d7d13c2f492c44a816781787f (diff)
downloadguix-d1b1c4249a1747262e48d15512ee5435da068182.tar.gz
Add `add-to-store' test for flat files.
* tests/derivations.scm ("add-to-store, flat"): New test.
-rw-r--r--tests/derivations.scm7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/derivations.scm b/tests/derivations.scm
index 1a85639930..3f48289380 100644
--- a/tests/derivations.scm
+++ b/tests/derivations.scm
@@ -66,6 +66,13 @@
 
 (test-skip (if %store 0 4))
 
+(test-assert "add-to-store, flat"
+  (let* ((file (search-path %load-path "language/tree-il/spec.scm"))
+         (drv  (add-to-store %store "flat-test" #t #f "sha256" file)))
+    (and (eq? 'regular (stat:type (stat drv)))
+         (equal? (call-with-input-file file get-bytevector-all)
+                 (call-with-input-file drv get-bytevector-all)))))
+
 (test-assert "add-to-store, recursive"
   (let* ((dir (dirname (search-path %load-path "language/tree-il/spec.scm")))
          (drv (add-to-store %store "dir-tree-test" #t #t "sha256" dir)))