fixed regexp-match-peek-positions* and added tests

svn: r9611
This commit is contained in:
Eli Barzilay 2008-05-02 23:00:57 +00:00
parent 4e54165e2a
commit 921ef6cfcb
2 changed files with 7 additions and 1 deletions

View File

@ -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

View File

@ -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* ----------