fix `regexp-match' variants given a long string and an output port
This commit is contained in:
parent
08b271d34c
commit
d194fa6245
|
@ -1310,6 +1310,20 @@
|
||||||
(let ([is (open-input-string "barfoo")])
|
(let ([is (open-input-string "barfoo")])
|
||||||
(test '(#f #\f) list (regexp-match "foo" is 0 3) (read-char is)))
|
(test '(#f #\f) list (regexp-match "foo" is 0 3) (read-char is)))
|
||||||
|
|
||||||
|
;; Check that lazy decoding of strings works right with sending
|
||||||
|
;; unmatched output to a port:
|
||||||
|
(for ([succeed? '(#f #t)])
|
||||||
|
(for ([N '(1 100 1000 1023 1024 10000)])
|
||||||
|
(define o (open-output-bytes))
|
||||||
|
(void (regexp-match-positions #rx"y"
|
||||||
|
(string-append
|
||||||
|
(make-string N #\x)
|
||||||
|
(if succeed? "y" ""))
|
||||||
|
0
|
||||||
|
(+ N (if succeed? 1 0))
|
||||||
|
o))
|
||||||
|
(test N bytes-length (get-output-bytes o))))
|
||||||
|
|
||||||
(arity-test regexp 1 1)
|
(arity-test regexp 1 1)
|
||||||
(arity-test regexp? 1 1)
|
(arity-test regexp? 1 1)
|
||||||
(arity-test regexp-match 2 6)
|
(arity-test regexp-match 2 6)
|
||||||
|
|
|
@ -5391,8 +5391,10 @@ static Scheme_Object *gen_compare(char *name, int pos,
|
||||||
startv, endv, &dropped,
|
startv, endv, &dropped,
|
||||||
prefix, prefix_len, prefix_offset);
|
prefix, prefix_len, prefix_offset);
|
||||||
|
|
||||||
if (lazy_string)
|
if (lazy_string) {
|
||||||
full_s = lazy_string->s;
|
full_s = lazy_string->s;
|
||||||
|
endset = lazy_string->end;
|
||||||
|
}
|
||||||
|
|
||||||
if (iport) {
|
if (iport) {
|
||||||
minpos = -prefix_len;
|
minpos = -prefix_len;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user