summaryrefslogtreecommitdiff
path: root/tests/utils.scm
diff options
context:
space:
mode:
authorFederico Beffa <beffa@fbengineering.ch>2015-11-14 15:00:36 +0100
committerFederico Beffa <beffa@fbengineering.ch>2015-11-26 18:17:23 +0100
commitc8be6f0d4a4ad72b1c0673c4cf11a65cd1079d8c (patch)
treecf804d6c9ffe0208936810a27f43fb22ec9a9c21 /tests/utils.scm
parent94abc84887ddbb56c0428a4ad783318845fcb281 (diff)
utils: Add 'canonical-newline-port'.
* guix/utils.scm (canonical-newline-port): New procedure. * tests/utils.scm ("canonical-newline-port"): New test.
Diffstat (limited to 'tests/utils.scm')
-rw-r--r--tests/utils.scm6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/utils.scm b/tests/utils.scm
index b65d6d20ba9..04a859fc9d1 100644
--- a/tests/utils.scm
+++ b/tests/utils.scm
@@ -318,6 +318,12 @@
318 (string-append (%store-prefix) 318 (string-append (%store-prefix)
319 "/qvs2rj2ia5vci3wsdb7qvydrmacig4pg-bash-4.2-p24"))) 319 "/qvs2rj2ia5vci3wsdb7qvydrmacig4pg-bash-4.2-p24")))
320 320
321(test-equal "canonical-newline-port"
322 "This is a journey\nInto the sound\nA journey ...\n"
323 (let ((port (open-string-input-port
324 "This is a journey\r\nInto the sound\r\nA journey ...\n")))
325 (get-string-all (canonical-newline-port port))))
326
321(test-end) 327(test-end)
322 328
323(false-if-exception (delete-file temp-file)) 329(false-if-exception (delete-file temp-file))