aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRobert Vollmert <rob@vllmrt.net>2019-06-16 16:18:29 +0200
committerLudovic Courtès <ludo@gnu.org>2019-06-20 14:07:01 +0200
commit3149c002644b927e0245d237cdda3a6aeca00e4a (patch)
tree0c495ec745fa95d2ff3db07f5e59b3b06a667da2 /tests
parentc050f1870016a6bf6e79aee8e5abe5da366fa210 (diff)
downloadpatches-3149c002644b927e0245d237cdda3a6aeca00e4a.tar
patches-3149c002644b927e0245d237cdda3a6aeca00e4a.tar.gz
utils: canonical-newline-port: Fix handling of carriage return at buffer end.
Prior to this change the added test fails for me locally at byte 1024. It might depend on some default buffer sizes. Fixes <https://bugs.gnu.org/35863>. * tests/utils.scm ("canonical-newline-port-1024"): Add test. * guix/utils.scm (canonical-newline-port): Correct comments on CR/LF. Remove CR even when they're at the end of the buffer. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/utils.scm6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/utils.scm b/tests/utils.scm
index 44861384ab..f78ec356bd 100644
--- a/tests/utils.scm
+++ b/tests/utils.scm
@@ -230,6 +230,12 @@ skip these tests."
"This is a journey\r\nInto the sound\r\nA journey ...\n")))
(get-string-all (canonical-newline-port port))))
+(test-equal "canonical-newline-port-1024"
+ (string-concatenate (make-list 100 "0123456789abcde\n"))
+ (let ((port (open-string-input-port
+ (string-concatenate
+ (make-list 100 "0123456789abcde\r\n")))))
+ (get-string-all (canonical-newline-port port))))
(test-equal "edit-expression"
"(display \"GNU Guix\")\n(newline)\n"