summaryrefslogtreecommitdiff
path: root/test/ruby/test_regexp.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2022-03-31 18:01:15 +0900
committerGitHub <noreply@github.com>2022-03-31 18:01:15 +0900
commitd8189ed23f02dd197453279aeee9be1785337d4f (patch)
treef9f23ce77a5f5695fbde1abe75da846acb64b671 /test/ruby/test_regexp.rb
parentddd83e8462db32b7403470ef92ed73ee0daef02b (diff)
Return only captured range in `MatchData` [Bug #18670]
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/5740 Merged-By: nobu <nobu@ruby-lang.org>
Diffstat (limited to 'test/ruby/test_regexp.rb')
-rw-r--r--test/ruby/test_regexp.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/test/ruby/test_regexp.rb b/test/ruby/test_regexp.rb
index 7f787f99f5..4e840f23ad 100644
--- a/test/ruby/test_regexp.rb
+++ b/test/ruby/test_regexp.rb
@@ -488,6 +488,7 @@ class TestRegexp < Test::Unit::TestCase
assert_nil(m[5])
assert_raise(IndexError) { m[:foo] }
assert_raise(TypeError) { m[nil] }
+ assert_equal(["baz", nil], m[-2, 3])
end
def test_match_values_at