diff options
author | Ludovic Courtès <ludo@gnu.org> | 2022-12-12 15:03:35 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2022-12-12 15:03:35 +0100 |
commit | 302a84a593e4be417d739caf4e5385df536e3943 (patch) | |
tree | 3e9e908e52e3d4a141552d8fda9a7fbe2d41637c /tests/store-deduplication.scm | |
parent | 3677b97030e5954fa26bdb435e0d3379a1a4ec43 (diff) | |
parent | 6dbdb5fcf5640c126ac65479b835aba83aea2a6d (diff) | |
download | guix-302a84a593e4be417d739caf4e5385df536e3943.tar.gz |
Merge branch 'version-1.4.0'
Diffstat (limited to 'tests/store-deduplication.scm')
-rw-r--r-- | tests/store-deduplication.scm | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/tests/store-deduplication.scm b/tests/store-deduplication.scm index 2950fbc1a3..f1845035d8 100644 --- a/tests/store-deduplication.scm +++ b/tests/store-deduplication.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2018, 2020-2021 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2018, 2020-2022 Ludovic Courtès <ludo@gnu.org> ;;; ;;; This file is part of GNU Guix. ;;; @@ -136,6 +136,21 @@ (cons (apply = (map (compose stat:ino stat) identical)) (map (compose stat:nlink stat) identical)))))) +(test-assert "copy-file/deduplicate, below %deduplication-minimum-size" + (call-with-temporary-directory + (lambda (store) + (let ((source (string-append store "/input"))) + (call-with-output-file source + (lambda (port) + (display "Hello!\n" port))) + (copy-file/deduplicate source + (string-append store "/a") + #:store store) + (and (not (directory-exists? (string-append store "/.links"))) + (file=? source (string-append store "/a")) + (not (= (stat:ino (stat (string-append store "/a"))) + (stat:ino (stat source))))))))) + (test-assert "copy-file/deduplicate" (call-with-temporary-directory (lambda (store) |