diff --git a/test/strscan/test_stringscanner.rb b/test/strscan/test_stringscanner.rb index 9b7b7910d0db81..54fd5027cf2237 100644 --- a/test/strscan/test_stringscanner.rb +++ b/test/strscan/test_stringscanner.rb @@ -325,6 +325,9 @@ def test_scan_string s = create_string_scanner(str, false) matched = s.scan('str') assert_equal 'str', matched + + s = create_string_scanner("str") + assert_equal nil, s.scan("str\0\0") end def test_skip @@ -710,6 +713,9 @@ def test_scan_until_string assert_equal(nil, s.skip_until("Qux")) assert_equal("\u0000Baz", s.scan_until("Baz")) assert_equal(11, s.pos) + + s = create_string_scanner("str") + assert_equal nil, s.scan_until("str\0\0") end def test_skip_until