summaryrefslogtreecommitdiff
path: root/test/ruby/test_string.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_string.rb')
-rw-r--r--test/ruby/test_string.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb
index 615ede2234..7c685407d6 100644
--- a/test/ruby/test_string.rb
+++ b/test/ruby/test_string.rb
@@ -3376,6 +3376,9 @@ CODE
assert_equal(6, S("にんにちは").byteindex(S("に"), 6))
assert_equal(6, S("にんにちは").byteindex(/に./, 6))
assert_raise(IndexError) { S("にんにちは").byteindex(?に, 7) }
+
+ s = S("foobarbarbaz")
+ assert !1000.times.any? {s.byteindex("", 100_000_000)}
end
def test_byterindex