From 2a991f3ae4823730395c7970d83159e93d5f5fe2 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 23 May 2019 21:35:47 +0200 Subject: lzlib: Add 'make-lzip-input-port/compressed'. * guix/lzlib.scm (lzwrite!, make-lzip-input-port/compressed): New procedures. * tests/lzlib.scm ("make-lzip-input-port/compressed"): New test. * guix/tests.scm (%seed): Export. --- tests/lzlib.scm | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests/lzlib.scm') diff --git a/tests/lzlib.scm b/tests/lzlib.scm index cf53a9417d..543622bb45 100644 --- a/tests/lzlib.scm +++ b/tests/lzlib.scm @@ -108,4 +108,14 @@ (define (compress-and-decompress data) (test-assert* "Bytevector of size relative to Lzip internal buffers (1MiB+1)" (compress-and-decompress (random-bytevector (1+ (* 1024 1024))))) +(test-assert "make-lzip-input-port/compressed" + (let* ((len (pk 'len (+ 10 (random 4000 %seed)))) + (data (random-bytevector len)) + (compressed (make-lzip-input-port/compressed + (open-bytevector-input-port data))) + (result (call-with-lzip-input-port compressed + get-bytevector-all))) + (pk (bytevector-length result) (bytevector-length data)) + (bytevector=? result data))) + (test-end) -- cgit v1.2.3