fix `regexp-match' variants given a long string and an output port
... again; commit d194fa6245
turned out to be incomplete.
This commit is contained in:
parent
2b7c6e32a9
commit
442f6eaaae
|
@ -1314,15 +1314,16 @@
|
||||||
;; unmatched output to a port:
|
;; unmatched output to a port:
|
||||||
(for ([succeed? '(#f #t)])
|
(for ([succeed? '(#f #t)])
|
||||||
(for ([N '(1 100 1000 1023 1024 10000)])
|
(for ([N '(1 100 1000 1023 1024 10000)])
|
||||||
(define o (open-output-bytes))
|
(for ([M (list 0 (quotient N 2))])
|
||||||
(void (regexp-match-positions #rx"y"
|
(define o (open-output-bytes))
|
||||||
(string-append
|
(void (regexp-match-positions #rx"y"
|
||||||
(make-string N #\x)
|
(string-append
|
||||||
(if succeed? "y" ""))
|
(make-string N #\x)
|
||||||
0
|
(if succeed? "y" ""))
|
||||||
(+ N (if succeed? 1 0))
|
M
|
||||||
o))
|
(+ N (if succeed? 1 0))
|
||||||
(test N bytes-length (get-output-bytes o))))
|
o))
|
||||||
|
(test (- N M) 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)
|
||||||
|
|
|
@ -5386,7 +5386,7 @@ static Scheme_Object *gen_compare(char *name, int pos,
|
||||||
|
|
||||||
if (lazy_string) {
|
if (lazy_string) {
|
||||||
full_s = lazy_string->s;
|
full_s = lazy_string->s;
|
||||||
endset = lazy_string->end;
|
endset = lazy_string->end - lazy_string->start;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (iport) {
|
if (iport) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user