mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2026-05-26 19:11:46 +02:00
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.
This commit is contained in:
@@ -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"))
|
||||
|
||||
Reference in New Issue
Block a user