mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
test_regexp.rb: suppress warning
* test/ruby/test_regexp.rb (test_named_capture): suppress "assigned but unused variable" warning by prefixing '_'. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54537 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c372b1236e
commit
d9f6850ef3
1 changed files with 4 additions and 2 deletions
|
@ -111,8 +111,10 @@ class TestRegexp < Test::Unit::TestCase
|
|||
assert_equal('#<MatchData "& y" foo:"amp" foo:"y">',
|
||||
/&(?<foo>.*?); (?<foo>y)/.match("aaa & yyy").inspect)
|
||||
|
||||
/(?<id>[A-Za-z_]+)/ =~ "!abc"
|
||||
assert_equal("abc", Regexp.last_match(:id))
|
||||
/(?<_id>[A-Za-z_]+)/ =~ "!abc"
|
||||
assert_not_nil(Regexp.last_match)
|
||||
assert_equal("abc", Regexp.last_match(1))
|
||||
assert_equal("abc", Regexp.last_match(:_id))
|
||||
|
||||
/a/ =~ "b" # doesn't match.
|
||||
assert_equal(nil, Regexp.last_match)
|
||||
|
|
Loading…
Reference in a new issue