aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMark H Weaver <mhw@netris.org>2014-08-26 12:03:13 -0400
committerMark H Weaver <mhw@netris.org>2014-08-26 12:03:13 -0400
commit5cc4517590d4d517bf9e29db5d9c5e03e4e0ad26 (patch)
treeec8a7c9d7e449e192258b167d727e03f36a2b851 /tests
parentbc0506f5b75812431e8530e213ca642028743f9e (diff)
parentc2815c0f46d16b98559d0498ae683b0e36e25e7a (diff)
downloadpatches-5cc4517590d4d517bf9e29db5d9c5e03e4e0ad26.tar
patches-5cc4517590d4d517bf9e29db5d9c5e03e4e0ad26.tar.gz
Merge branch 'master' into core-updates
Diffstat (limited to 'tests')
-rw-r--r--tests/guix-register.sh19
1 files changed, 17 insertions, 2 deletions
diff --git a/tests/guix-register.sh b/tests/guix-register.sh
index 3f261d7bef..e99f5c6075 100644
--- a/tests/guix-register.sh
+++ b/tests/guix-register.sh
@@ -43,13 +43,28 @@ $new_file
0
EOF
-# Make sure it's valid, and delete it.
+# Register an idendical file, and make sure it gets deduplicated.
+new_file2="$new_file-duplicate"
+cat "$new_file" > "$new_file2"
+guix-register <<EOF
+$new_file2
+
+0
+EOF
+
+guile -c "
+ (exit (= (stat:ino (stat \"$new_file\"))
+ (stat:ino (stat \"$new_file2\"))))"
+
+# Make sure both are valid, and delete them.
guile -c "
(use-modules (guix store))
(define s (open-connection))
(exit (and (valid-path? s \"$new_file\")
+ (valid-path? s \"$new_file2\")
(null? (references s \"$new_file\"))
- (pair? (delete-paths s (list \"$new_file\")))))"
+ (null? (references s \"$new_file2\"))
+ (pair? (delete-paths s (list \"$new_file\" \"$new_file2\")))))"
#