mirror of
https://github.com/ruby/ruby.git
synced 2025-08-24 21:44:30 +02:00
re.c: fix up r55036
* re.c (match_values_at): fix regression at r55036. MatchData#values_at accepts Range. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55039 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
093c389390
commit
7f860741b9
3 changed files with 27 additions and 3 deletions
|
@ -383,6 +383,7 @@ class TestRegexp < Test::Unit::TestCase
|
|||
def test_match_values_at
|
||||
m = /(...)(...)(...)(...)?/.match("foobarbaz")
|
||||
assert_equal(["foo", "bar", "baz"], m.values_at(1, 2, 3))
|
||||
assert_equal(["foo", "bar", "baz"], m.values_at(1..3))
|
||||
|
||||
m = /(?<a>\d+) *(?<op>[+\-*\/]) *(?<b>\d+)/.match("1 + 2")
|
||||
assert_equal(["1", "2", "+"], m.values_at(:a, 'b', :op))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue