mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-23 19:19:20 -05:00
tests: Test 'add-to-store' with several hash algorithms.
* tests/store.scm ("add-to-store"): New test.
This commit is contained in:
parent
1ad5209d90
commit
73b27eaa64
1 changed files with 12 additions and 0 deletions
|
@ -115,6 +115,18 @@ (define %shell
|
|||
(passwd:name (getpwuid (getuid)))))))
|
||||
(list (stat:uid s) (stat:perms s))))
|
||||
|
||||
(test-equal "add-to-store"
|
||||
'("sha1" "sha256" "sha512")
|
||||
(let* ((file (search-path %load-path "guix.scm"))
|
||||
(content (call-with-input-file file get-bytevector-all)))
|
||||
(map (lambda (hash-algo)
|
||||
(let ((file (add-to-store %store "guix.scm" #f hash-algo file)))
|
||||
(and (direct-store-path? file)
|
||||
(bytevector=? (call-with-input-file file get-bytevector-all)
|
||||
content)
|
||||
hash-algo)))
|
||||
'("sha1" "sha256" "sha512"))))
|
||||
|
||||
(test-equal "add-data-to-store"
|
||||
#vu8(1 2 3 4 5)
|
||||
(call-with-input-file (add-data-to-store %store "data" #vu8(1 2 3 4 5))
|
||||
|
|
Loading…
Reference in a new issue