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

ruby-changes:56278

From: Nobuyoshi <ko1@a...>
Date: Sun, 30 Jun 2019 08:50:33 +0900 (JST)
Subject: [ruby-changes:56278] Nobuyoshi Nakada: 45ba027d08 (trunk): Removed unused variables

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

From 45ba027d086a04e09ed6ad48c5ac78e61f1174c4 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Sat, 29 Jun 2019 21:19:01 +0900
Subject: Removed unused variables


diff --git a/test/csv/interface/test_read_write.rb b/test/csv/interface/test_read_write.rb
index 9ce3553..877e5f3 100644
--- a/test/csv/interface/test_read_write.rb
+++ b/test/csv/interface/test_read_write.rb
@@ -6,7 +6,6 @@ class TestCSVInterfaceReadWrite < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/csv/interface/test_read_write.rb#L6
   extend DifferentOFS
 
   def test_filter
-    rows = [[1, 2, 3], [4, 5]]
     input = <<-CSV
 1;2;3
 4;5
diff --git a/test/net/imap/test_imap.rb b/test/net/imap/test_imap.rb
index bdae8f2..b97be4f 100644
--- a/test/net/imap/test_imap.rb
+++ b/test/net/imap/test_imap.rb
@@ -641,7 +641,7 @@ EOF https://github.com/ruby/ruby/blob/trunk/test/net/imap/test_imap.rb#L641
 
     begin
       imap = Net::IMAP.new(server_addr, :port => port)
-      resp = imap.append("INBOX", mail)
+      imap.append("INBOX", mail)
       assert_equal(1, requests.length)
       assert_equal("RUBY0001 APPEND INBOX {#{mail.size}}\r\n", requests[0])
       assert_equal(mail, received_mail)
@@ -664,7 +664,6 @@ Subject: hello https://github.com/ruby/ruby/blob/trunk/test/net/imap/test_imap.rb#L664
 hello world
 EOF
     requests = []
-    received_mail = nil
     start_server do
       sock = server.accept
       begin
diff --git a/test/net/smtp/test_smtp.rb b/test/net/smtp/test_smtp.rb
index 23e1542..90c92e0 100644
--- a/test/net/smtp/test_smtp.rb
+++ b/test/net/smtp/test_smtp.rb
@@ -190,7 +190,7 @@ module Net https://github.com/ruby/ruby/blob/trunk/test/net/smtp/test_smtp.rb#L190
       loop do
         readable, = IO.select(servers.map(&:to_io))
         readable.each do |r|
-          sock, addr = r.accept_nonblock(exception: false)
+          sock, = r.accept_nonblock(exception: false)
           next if sock == :wait_readable
           return sock
         end
diff --git a/test/rdoc/test_rdoc_servlet.rb b/test/rdoc/test_rdoc_servlet.rb
index 0a197a3..a3d4246 100644
--- a/test/rdoc/test_rdoc_servlet.rb
+++ b/test/rdoc/test_rdoc_servlet.rb
@@ -224,7 +224,7 @@ class TestRDocServlet < RDoc::TestCase https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_servlet.rb#L224
 
     generator = @s.generator_for store
 
-    readme = store.add_file 'README.rdoc', parser: RDoc::Parser::Simple
+    store.add_file 'README.rdoc', parser: RDoc::Parser::Simple
 
     @s.documentation_page store, generator, 'README_rdoc.html', @req, @res
 
diff --git a/test/ruby/test_bignum.rb b/test/ruby/test_bignum.rb
index 58d63a7..434c5be 100644
--- a/test/ruby/test_bignum.rb
+++ b/test/ruby/test_bignum.rb
@@ -10,7 +10,6 @@ class TestBignum < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_bignum.rb#L10
   FIXNUM_MAX = RbConfig::LIMITS['FIXNUM_MAX']
 
   BIGNUM_MIN = FIXNUM_MAX + 1
-  b = BIGNUM_MIN
 
   f = BIGNUM_MIN
   n = 0
@@ -612,7 +611,6 @@ class TestBignum < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_bignum.rb#L611
       return # GMP doesn't support interrupt during an operation.
     end
     time = Time.now
-    start_flag = false
     end_flag = false
     num = (65536 ** 65536)
     q = Queue.new
diff --git a/test/ruby/test_file_exhaustive.rb b/test/ruby/test_file_exhaustive.rb
index 02890bb..0612a61 100644
--- a/test/ruby/test_file_exhaustive.rb
+++ b/test/ruby/test_file_exhaustive.rb
@@ -683,7 +683,6 @@ class TestFileExhaustive < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_file_exhaustive.rb#L683
   def test_utime_symlinkfile
     return unless symlinkfile
     t = Time.local(2000)
-    stat = File.lstat(symlinkfile)
     assert_equal(1, File.utime(t, t, symlinkfile))
     assert_equal(t, File.stat(regular_file).atime)
     assert_equal(t, File.stat(regular_file).mtime)
diff --git a/test/ruby/test_numeric.rb b/test/ruby/test_numeric.rb
index f48bce5..4e5404a 100644
--- a/test/ruby/test_numeric.rb
+++ b/test/ruby/test_numeric.rb
@@ -52,7 +52,6 @@ class TestNumeric < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_numeric.rb#L52
     end.new
     assert_equal(-1, -a)
 
-    bug7688 = '[ruby-core:51389] [Bug #7688]'
     a = Class.new(Numeric) do
       def coerce(x); raise StandardError, "my error"; end
     end.new
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb
index fb3f50a..02efc16 100644
--- a/test/ruby/test_process.rb
+++ b/test/ruby/test_process.rb
@@ -2362,7 +2362,6 @@ EOS https://github.com/ruby/ruby/blob/trunk/test/ruby/test_process.rb#L2362
           w.syswrite("exec failed\n")
         end
         q = Queue.new
-        run = true
         th1 = Thread.new { i = 0; i += 1 while q.empty?; i }
         th2 = Thread.new { j = 0; j += 1 while q.empty? && Thread.pass.nil?; j }
         sleep 0.5
diff --git a/test/ruby/test_system.rb b/test/ruby/test_system.rb
index 4777679..31c9cd7 100644
--- a/test/ruby/test_system.rb
+++ b/test/ruby/test_system.rb
@@ -188,7 +188,7 @@ class TestSystem < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_system.rb#L188
       name = "\u{30c6 30b9 30c8}"
       tmpfilename = "#{tmpdir}/#{name}.cmd"
       message = /#{name}\.cmd/
-      e = assert_raise_with_message(Errno::ENOENT, message) do
+      assert_raise_with_message(Errno::ENOENT, message) do
         system(tmpfilename, exception: true)
       end
       open(tmpfilename, "w") {|f|
@@ -196,7 +196,7 @@ class TestSystem < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_system.rb#L196
         f.puts "exit 127"
         f.chmod(0755)
       }
-      e = assert_raise_with_message(RuntimeError, message) do
+      assert_raise_with_message(RuntimeError, message) do
         system(tmpfilename, exception: true)
       end
     end
diff --git a/test/ruby/test_thread_queue.rb b/test/ruby/test_thread_queue.rb
index 8cebbbe..4e34bb4 100644
--- a/test/ruby/test_thread_queue.rb
+++ b/test/ruby/test_thread_queue.rb
@@ -474,7 +474,7 @@ class TestThreadQueue < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_thread_queue.rb#L474
     prod_threads.each{|t|
       begin
         t.join
-      rescue => e
+      rescue
       end
     }
   end
diff --git a/test/socket/test_nonblock.rb b/test/socket/test_nonblock.rb
index 3f8d548..5d45593 100644
--- a/test/socket/test_nonblock.rb
+++ b/test/socket/test_nonblock.rb
@@ -185,11 +185,11 @@ class TestSocketNonblock < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/socket/test_nonblock.rb#L185
   def udp_pair
     s1 = UDPSocket.new
     s1.bind('127.0.0.1', 0)
-    af, port1, host, addr1 = s1.addr
+    _, port1, _, addr1 = s1.addr
 
     s2 = UDPSocket.new
     s2.bind('127.0.0.1', 0)
-    af, port2, host, addr2 = s2.addr
+    _, port2, _, addr2 = s2.addr
 
     s1.connect(addr2, port2)
     s2.connect(addr1, port1)
diff --git a/test/test_open3.rb b/test/test_open3.rb
index 6842ac8..848f70b 100644
--- a/test/test_open3.rb
+++ b/test/test_open3.rb
@@ -77,7 +77,7 @@ class TestOpen3 < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/test_open3.rb#L77
   end
 
   def test_env
-    result = Open3.popen3({'A' => 'B', 'C' => 'D'}, RUBY, '-e' 'p ENV["A"]') do |i, out, err, thr|
+    Open3.popen3({'A' => 'B', 'C' => 'D'}, RUBY, '-e' 'p ENV["A"]') do |i, out, err, thr|
       output = out.read
       assert_equal("\"B\"\n", output)
     end
diff --git a/test/test_prime.rb b/test/test_prime.rb
index 9c793da..3e5997f 100644
--- a/test/test_prime.rb
+++ b/test/test_prime.rb
@@ -74,7 +74,7 @@ class TestPrime < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/test_prime.rb#L74
   end
 
   def test_new
-    exception = assert_raise(NoMethodError) { Prime.new }
+    assert_raise(NoMethodError) { Prime.new }
   end
 
   def test_enumerator_succ
diff --git a/test/win32ole/test_win32ole_event.rb b/test/win32ole/test_win32ole_event.rb
index 3ab60c9..0c819fc 100644
--- a/test/win32ole/test_win32ole_event.rb
+++ b/test/win32ole/test_win32ole_event.rb
@@ -25,9 +25,8 @@ end https://github.com/ruby/ruby/blob/trunk/test/win32ole/test_win32ole_event.rb#L25
 def swbemsink_available?
   available = false
   if defined?(WIN32OLE)
-    wmi = nil
     begin
-      wmi = WIN32OLE.new('WbemScripting.SWbemSink')
+      WIN32OLE.new('WbemScripting.SWbemSink')
       available = true
     rescue
     end
@@ -422,7 +421,7 @@ if defined?(WIN32OLE_EVENT) https://github.com/ruby/ruby/blob/trunk/test/win32ole/test_win32ole_event.rb#L421
           $SAFE=1
           str = 'ConnectionEvents'
           str.taint
-          ev = WIN32OLE_EVENT.new(@db, str)
+          WIN32OLE_EVENT.new(@db, str)
         }
         exc = assert_raise(SecurityError) {
           th.join
-- 
cgit v0.10.2


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

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