From 921ef6cfcb4a8d31b3a8d9f4671020921fe3577d Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Fri, 2 May 2008 23:00:57 +0000 Subject: [PATCH] fixed regexp-match-peek-positions* and added tests svn: r9611 --- collects/scheme/private/string.ss | 3 ++- collects/tests/mzscheme/string.ss | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/collects/scheme/private/string.ss b/collects/scheme/private/string.ss index da8460b8e1..d50236b433 100644 --- a/collects/scheme/private/string.ss +++ b/collects/scheme/private/string.ss @@ -225,7 +225,8 @@ (cond [end (= mend end)] [len (= mend len)] [(input-port? string) - (eof-object? (peek-byte string))] + (eof-object? + (peek-byte string (if peek? mend 0)))] [else (error "internal error (str)")])) (failure-k acc start end) (if port-success-k diff --git a/collects/tests/mzscheme/string.ss b/collects/tests/mzscheme/string.ss index 22d27e0d35..3a37429994 100644 --- a/collects/tests/mzscheme/string.ss +++ b/collects/tests/mzscheme/string.ss @@ -230,6 +230,11 @@ (t '((1 . 1) (2 . 3) (4 . 4)) eof " *" "12 34") (t '((0 . 1) (2 . 2) (3 . 4) (5 . 5) (6 . 7)) eof " *" " 12 34 ") (t '((2 . 2) (3 . 4) (5 . 5)) " " " *" " 12 34 " 1 6) + (t regexp-match-peek-positions*) + (t '((1 . 1) (2 . 2)) "123" "" "123") + (t '((1 . 1) (2 . 3) (4 . 4)) "12 34" " *" "12 34") + (t '((0 . 1) (2 . 2) (3 . 4) (5 . 5) (6 . 7)) " 12 34 " " *" " 12 34 ") + (t '((2 . 2) (3 . 4) (5 . 5)) " 12 34 " " *" " 12 34 " 1 6) ) ;; ---------- string-append* ----------