File tree 2 files changed +10
-0
lines changed
2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change 80
80
return Char (c), i
81
81
end
82
82
83
+ # This implementation relies on `next` returning a value past the end of the
84
+ # String's underlying data, which is true for valid Strings
85
+ done (s:: String , state) = state > endof (s. data)
86
+
83
87
@inline function next (s:: String , i:: Int )
84
88
# function is split into this critical fast-path
85
89
# for pure ascii data, such as parsing numbers,
Original file line number Diff line number Diff line change @@ -427,3 +427,9 @@ foobaz(ch) = reinterpret(Char, typemax(UInt32))
427
427
428
428
# issue #17624, missing getindex method for String
429
429
@test " abc" [:] == " abc"
430
+
431
+ # issue #18280: next/nextind must return past String's underlying data
432
+ for s in (" Hello" , " Σ" , " こんにちは" , " 😊😁" )
433
+ @test next (s, endof (s))[2 ] > endof (s. data)
434
+ @test nextind (s, endof (s)) > endof (s. data)
435
+ end
You can’t perform that action at this time.
0 commit comments