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

ruby-changes:65942

From: Yusuke <ko1@a...>
Date: Fri, 23 Apr 2021 22:11:57 +0900 (JST)
Subject: [ruby-changes:65942] 71ee05c936 (master): test/ruby/test_assignment.rb: Avoid "assigned but unused variable"

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

From 71ee05c9363935d0c6db01cb22edfdb2b128af4f Mon Sep 17 00:00:00 2001
From: Yusuke Endoh <mame@r...>
Date: Fri, 23 Apr 2021 22:11:01 +0900
Subject: test/ruby/test_assignment.rb: Avoid "assigned but unused variable"

---
 test/ruby/test_assignment.rb | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/test/ruby/test_assignment.rb b/test/ruby/test_assignment.rb
index a5d9348..41e8bff 100644
--- a/test/ruby/test_assignment.rb
+++ b/test/ruby/test_assignment.rb
@@ -110,7 +110,7 @@ class TestAssignment < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_assignment.rb#L110
     assert_equal([:x1, :y1, :x2, :x3, :x4, :r1, :r2, [:z=, :r1], [:[]=, 1, 2, 3, [6, 7]], [:[]=, 4, :r2], [:x5=, 8]], order)
     order.clear
 
-    (x1.y1.z, x2.x5), a = [r1, r2], 7
+    (x1.y1.z, x2.x5), _a = [r1, r2], 7
     assert_equal([:x1, :y1, :x2, :r1, :r2, [:z=, :r1], [:x5=, :r2]], order)
     order.clear
 
@@ -130,11 +130,11 @@ class TestAssignment < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_assignment.rb#L130
     assert_equal([:x1, :y1, :x1, :x2, :x3, :x4, :r1, :r2, [:z=, :r1], [:x5=, 5], [:[]=, 1, 2, 3, [6, 7]], [:[]=, 4, :r2], [:x5=, 8]], order)
     order.clear
 
-    ((x1.y1.z, x1.x5), a), *x2[1, 2, 3], ((x3[4], x4.x5), b) = [[r1, 5], 10], 6, 7, [[r2, 8], 11]
+    ((x1.y1.z, x1.x5), _a), *x2[1, 2, 3], ((x3[4], x4.x5), _b) = [[r1, 5], 10], 6, 7, [[r2, 8], 11]
     assert_equal([:x1, :y1, :x1, :x2, :x3, :x4, :r1, :r2, [:z=, :r1], [:x5=, 5], [:[]=, 1, 2, 3, [6, 7]], [:[]=, 4, :r2], [:x5=, 8]], order)
     order.clear
 
-    ((x1.y1.z, *x1.x5), a), *x2[1, 2, 3], ((*x3[4], x4.x5), b) = [[r1, 5], 10], 6, 7, [[r2, 8], 11]
+    ((x1.y1.z, *x1.x5), _a), *x2[1, 2, 3], ((*x3[4], x4.x5), _b) = [[r1, 5], 10], 6, 7, [[r2, 8], 11]
     assert_equal([:x1, :y1, :x1, :x2, :x3, :x4, :r1, :r2, [:z=, :r1], [:x5=, [5]], [:[]=, 1, 2, 3, [6, 7]], [:[]=, 4, [:r2]], [:x5=, 8]], order)
     order.clear
   end
-- 
cgit v1.1


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

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