diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2014-03-22 21:58:23 +0100 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2014-03-22 22:57:09 +0100 |
| commit | 7a8024a33ad862fdbc8ae741f0a6f5338cb5b82b (patch) | |
| tree | c2ab108d3f49f4ead6f964ae46e1c0c3678df66c /tests/utils.scm | |
| parent | 443eb4e9506026094f5e0dadc3e11d3cf7a86a24 (diff) | |
utils: Add 'decompressed-port' and 'compressed-port'.
* guix/utils.scm (decompressed-port, compressed-port): New procedures.
* guix/scripts/substitute-binary.scm (decompressed-port): Remove.
(guix-substitute-binary): Pass a symbol or #f as the first argument to
'decompress-port'.
* tests/utils.scm ("compressed-port, decompressed-port, non-file"): New
test.
Diffstat (limited to 'tests/utils.scm')
| -rw-r--r-- | tests/utils.scm | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/utils.scm b/tests/utils.scm index 85daa3db919..39cad701b89 100644 --- a/tests/utils.scm +++ b/tests/utils.scm | |||
| @@ -150,6 +150,17 @@ | |||
| 150 | (any (compose (negate zero?) cdr waitpid) | 150 | (any (compose (negate zero?) cdr waitpid) |
| 151 | pids)))) | 151 | pids)))) |
| 152 | 152 | ||
| 153 | (test-assert "compressed-port, decompressed-port, non-file" | ||
| 154 | (let ((data (call-with-input-file (search-path %load-path "guix.scm") | ||
| 155 | get-bytevector-all))) | ||
| 156 | (let*-values (((compressed pids1) | ||
| 157 | (compressed-port 'xz (open-bytevector-input-port data))) | ||
| 158 | ((decompressed pids2) | ||
| 159 | (decompressed-port 'xz compressed))) | ||
| 160 | (and (every (compose zero? cdr waitpid) | ||
| 161 | (append pids1 pids2)) | ||
| 162 | (equal? (get-bytevector-all decompressed) data))))) | ||
| 163 | |||
| 153 | (false-if-exception (delete-file temp-file)) | 164 | (false-if-exception (delete-file temp-file)) |
| 154 | (test-equal "fcntl-flock wait" | 165 | (test-equal "fcntl-flock wait" |
| 155 | 42 ; the child's exit status | 166 | 42 ; the child's exit status |
