[ruby/strscan] jruby: Pass end index to byteListToInum

(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
This commit is contained in:
Charles Oliver Nutter 2025-05-02 19:26:53 -05:00 committed by Hiroshi SHIBATA
parent 61b6f226e8
commit 5a0306f9c1
No known key found for this signature in database
GPG Key ID: F9CF13417264FAC2

View File

@ -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