summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorYusuke Endoh <mame@ruby-lang.org>2020-12-16 16:17:54 +0900
committerYusuke Endoh <mame@ruby-lang.org>2020-12-16 16:17:54 +0900
commitc668772b145b7fd889000480778e011a808442ab (patch)
treed384689cfac53ba442c2909b88b077bac9dba3fb /test
parent19157a3c001d68acdc8e5190a806189840d23375 (diff)
test/ruby/test_enum.rb: Avoid "warning: assigned but unused variable"
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_enum.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/ruby/test_enum.rb b/test/ruby/test_enum.rb
index aa93b95c2a..3d0420972f 100644
--- a/test/ruby/test_enum.rb
+++ b/test/ruby/test_enum.rb
@@ -66,22 +66,22 @@ class TestEnumerable < Test::Unit::TestCase
def test_grep_optimization
bug17030 = '[ruby-core:99156]'
'set last match' =~ /set last (.*)/
- assert_equal([:a, 'b', :c], [:a, 'b', 'z', :c, 42, nil].grep(/[a-d]/))
- assert_equal(['z', 42, nil], [:a, 'b', 'z', :c, 42, nil].grep_v(/[a-d]/))
- assert_equal('match', $1)
+ assert_equal([:a, 'b', :c], [:a, 'b', 'z', :c, 42, nil].grep(/[a-d]/), bug17030)
+ assert_equal(['z', 42, nil], [:a, 'b', 'z', :c, 42, nil].grep_v(/[a-d]/), bug17030)
+ assert_equal('match', $1, bug17030)
regexp = Regexp.new('x')
- assert_equal([], @obj.grep(regexp)) # sanity check
+ assert_equal([], @obj.grep(regexp), bug17030) # sanity check
def regexp.===(other)
true
end
- assert_equal([1, 2, 3, 1, 2], @obj.grep(regexp))
+ assert_equal([1, 2, 3, 1, 2], @obj.grep(regexp), bug17030)
o = Object.new
def o.to_str
'hello'
end
- assert_same(o, [o].grep(/ll/).first)
+ assert_same(o, [o].grep(/ll/).first, bug17030)
end
def test_count