[前][次][番号順一覧][スレッド一覧]

ruby-changes:64204

From: Yusuke <ko1@a...>
Date: Wed, 16 Dec 2020 16:18:41 +0900 (JST)
Subject: [ruby-changes:64204] c668772b14 (master): test/ruby/test_enum.rb: Avoid "warning: assigned but unused variable"

https://git.ruby-lang.org/ruby.git/commit/?id=c668772b14

From c668772b145b7fd889000480778e011a808442ab Mon Sep 17 00:00:00 2001
From: Yusuke Endoh <mame@r...>
Date: Wed, 16 Dec 2020 16:17:54 +0900
Subject: test/ruby/test_enum.rb: Avoid "warning: assigned but unused variable"


diff --git a/test/ruby/test_enum.rb b/test/ruby/test_enum.rb
index aa93b95..3d04209 100644
--- a/test/ruby/test_enum.rb
+++ b/test/ruby/test_enum.rb
@@ -66,22 +66,22 @@ class TestEnumerable < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_enum.rb#L66
   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
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]