diff --git a/collects/tests/racket/basic.rktl b/collects/tests/racket/basic.rktl index 70afe27c51..39cfd2d63f 100644 --- a/collects/tests/racket/basic.rktl +++ b/collects/tests/racket/basic.rktl @@ -1314,15 +1314,16 @@ ;; 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)))) + (for ([M (list 0 (quotient N 2))]) + (define o (open-output-bytes)) + (void (regexp-match-positions #rx"y" + (string-append + (make-string N #\x) + (if succeed? "y" "")) + M + (+ N (if succeed? 1 0)) + o)) + (test (- N M) bytes-length (get-output-bytes o))))) (arity-test regexp 1 1) (arity-test regexp? 1 1) diff --git a/src/racket/src/regexp.c b/src/racket/src/regexp.c index 660fa085df..1480a2f5e1 100644 --- a/src/racket/src/regexp.c +++ b/src/racket/src/regexp.c @@ -5386,7 +5386,7 @@ static Scheme_Object *gen_compare(char *name, int pos, if (lazy_string) { full_s = lazy_string->s; - endset = lazy_string->end; + endset = lazy_string->end - lazy_string->start; } if (iport) {