don't use unsafe-string-ref' in for'

because `unsafe-string-ref' is for ASCII results, only
This commit is contained in:
Matthew Flatt 2010-12-03 11:10:11 -07:00
parent 3d3d71de00
commit 7ec0731cda
2 changed files with 3 additions and 1 deletions

View File

@ -629,7 +629,7 @@
#'unsafe-vector-ref))
(define-:vector-like-gen :string-gen unsafe-string-ref)
(define-:vector-like-gen :string-gen string-ref)
(define-in-vector-like in-string
"string" string? string-length :string-gen)

View File

@ -25,7 +25,9 @@
(test-generator [(b d f)] (in-vector #(a b c d e f g h) 1 6 2))
(test-generator [(h f d)] (in-vector #(a b c d e f g h) 7 2 -2))
(test-generator [(#\a #\b #\c)] "abc")
(test-generator [(#\a #\u3bb #\c)] "a\u03BBc")
(test-generator [(#\a #\b #\c)] (in-string "abc"))
(test-generator [(#\a #\u3bb #\c)] (in-string "a\u03BBc"))
(test-generator [(#\a #\b #\c)] (in-string "zzabc" 2))
(test-generator [(#\a #\b #\c)] (in-string "zzabc" 2 #f))
(test-generator [(#\a #\b #\c)] (in-string "zzabcqq" 2 5))