Skip to content

Commit ce204b7

Browse files
committed
Test that next(s, endof(s)) > endof(s.data)
1 parent 579366b commit ce204b7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/strings/basic.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,3 +427,10 @@ foobaz(ch) = reinterpret(Char, typemax(UInt32))
427427

428428
# issue #17624, missing getindex method for String
429429
@test "abc"[:] == "abc"
430+
431+
# we assume for performance that next/nextind return values past the end of a
432+
# string's underlying data; this helps with performance of `done`.
433+
for s in ("Hello", "Σ", "こんにちは", "😊😁")
434+
@test next(s, endof(s))[2] > endof(s.data)
435+
@test nextind(s, endof(s)) > endof(s.data)
436+
end

0 commit comments

Comments
 (0)