mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2026-05-28 12:01:49 +02:00
store: Add 'add-data-to-store'.
* guix/serialization.scm (write-bytevector): New procedure.
(write-string): Rewrite in terms of 'write-bytevector'.
* guix/store.scm (write-arg): Add 'bytevector' case.
(add-data-to-store): New procedure, from former 'add-text-to-store'.
(add-text-to-store): Rewrite in terms of 'add-data-to-store'.
* tests/store.scm ("add-data-to-store"): New test.
This commit is contained in:
@@ -92,6 +92,11 @@
|
||||
|
||||
(test-skip (if %store 0 13))
|
||||
|
||||
(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))
|
||||
get-bytevector-all))
|
||||
|
||||
(test-assert "valid-path? live"
|
||||
(let ((p (add-text-to-store %store "hello" "hello, world")))
|
||||
(valid-path? %store p)))
|
||||
|
||||
Reference in New Issue
Block a user