summaryrefslogtreecommitdiff
path: root/test/strscan/test_stringscanner.rb
diff options
context:
space:
mode:
authorCharles Oliver Nutter <[email protected]>2025-05-02 19:26:53 -0500
committerHiroshi SHIBATA <[email protected]>2025-05-08 18:03:04 +0900
commit5a0306f9c1cd3c60d8b4735565a8cd794eb20ca6 (patch)
tree1b1a2f1ceab097726bad5fa35cbe45aad3784a28 /test/strscan/test_stringscanner.rb
parent61b6f226e8b5067bf2bc38ea36a4540e45371702 (diff)
[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
Diffstat (limited to 'test/strscan/test_stringscanner.rb')
-rw-r--r--test/strscan/test_stringscanner.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/strscan/test_stringscanner.rb b/test/strscan/test_stringscanner.rb
index e895a8382b..109f8e1f9a 100644
--- a/test/strscan/test_stringscanner.rb
+++ b/test/strscan/test_stringscanner.rb
@@ -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