From c8be6f0d4a4ad72b1c0673c4cf11a65cd1079d8c Mon Sep 17 00:00:00 2001 From: Federico Beffa Date: Sat, 14 Nov 2015 15:00:36 +0100 Subject: utils: Add 'canonical-newline-port'. * guix/utils.scm (canonical-newline-port): New procedure. * tests/utils.scm ("canonical-newline-port"): New test. --- tests/utils.scm | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests/utils.scm') 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)) -- cgit v1.2.3