From 0d268c5d701423b770b05ed208461c47709dafb7 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 29 Jan 2017 12:55:24 +0100 Subject: 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. --- tests/store.scm | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests/store.scm') diff --git a/tests/store.scm b/tests/store.scm index 983766d862..64d3553f25 100644 --- a/tests/store.scm +++ b/tests/store.scm @@ -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))) -- cgit 1.4.1