mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
utils: Add 'canonical-newline-port'.
* guix/utils.scm (canonical-newline-port): New procedure. * tests/utils.scm ("canonical-newline-port"): New test.
This commit is contained in:
parent
94abc84887
commit
c8be6f0d4a
2 changed files with 38 additions and 2 deletions
|
@ -318,6 +318,12 @@
|
|||
(string-append (%store-prefix)
|
||||
"/qvs2rj2ia5vci3wsdb7qvydrmacig4pg-bash-4.2-p24")))
|
||||
|
||||
(test-equal "canonical-newline-port"
|
||||
"This is a journey\nInto the sound\nA journey ...\n"
|
||||
(let ((port (open-string-input-port
|
||||
"This is a journey\r\nInto the sound\r\nA journey ...\n")))
|
||||
(get-string-all (canonical-newline-port port))))
|
||||
|
||||
(test-end)
|
||||
|
||||
(false-if-exception (delete-file temp-file))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue