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)
downloadpatches-c8be6f0d4a4ad72b1c0673c4cf11a65cd1079d8c.tar
patches-c8be6f0d4a4ad72b1c0673c4cf11a65cd1079d8c.tar.gz
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 b65d6d20ba..04a859fc9d 100644
--- a/tests/utils.scm
+++ b/tests/utils.scm
@@ -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))