(https://github.com/ruby/strscan/pull/150)
These parse methods take begin and end indices, not begin and length. A
test is included.
Fixes https://github.com/jruby/jruby/issues/8823
https://github.com/ruby/strscan/commit/
9690e39e73
@@ -1006,6 +1006,12 @@ module StringScannerTests
assert_equal(huge_integer.to_i, s.scan_integer)
assert_equal(2_000, s.pos)
assert_predicate(s, :matched?)
+
+ s = create_string_scanner('abc1')
+ s.pos = 3
+ assert_equal(1, s.scan_integer)
+ assert_equal(4, s.pos)
+ assert_predicate(s, :matched?)
end
def test_scan_integer_unmatch