diff options
author | Ludovic Courtès <ludo@gnu.org> | 2014-02-21 17:37:55 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2014-02-21 23:49:52 +0100 |
commit | a93e91ff484005e05491621664ab71f888ad2ba2 (patch) | |
tree | bc9e01f0b9bd52fc5c584f59e87b8ba78f6629cd /tests/nar.scm | |
parent | 86d07a5514d859772980ef87e39f6e2b668655c0 (diff) | |
download | patches-a93e91ff484005e05491621664ab71f888ad2ba2.tar patches-a93e91ff484005e05491621664ab71f888ad2ba2.tar.gz |
nar: 'write-file' can write to non-file ports.
* guix/nar.scm (write-contents): Use 'sendfile' only when P is a file
port.
* tests/nar.scm ("write-file supports non-file output ports"): New test.
Diffstat (limited to 'tests/nar.scm')
-rw-r--r-- | tests/nar.scm | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/nar.scm b/tests/nar.scm index 9f21f990c8..7ae8cf0aa7 100644 --- a/tests/nar.scm +++ b/tests/nar.scm @@ -183,6 +183,13 @@ (test-begin "nar") +(test-assert "write-file supports non-file output ports" + (let ((input (string-append (dirname (search-path %load-path "guix.scm")) + "/guix")) + (output (%make-void-port "w"))) + (write-file input output) + #t)) + (test-assert "write-file + restore-file" (let* ((input (string-append (dirname (search-path %load-path "guix.scm")) "/guix")) |