mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Removed unused variables
This commit is contained in:
parent
9f648262f9
commit
45ba027d08
14 changed files with 12 additions and 20 deletions
|
@ -6,7 +6,6 @@ class TestCSVInterfaceReadWrite < Test::Unit::TestCase
|
|||
extend DifferentOFS
|
||||
|
||||
def test_filter
|
||||
rows = [[1, 2, 3], [4, 5]]
|
||||
input = <<-CSV
|
||||
1;2;3
|
||||
4;5
|
||||
|
|
|
@ -641,7 +641,7 @@ EOF
|
|||
|
||||
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
|
|||
hello world
|
||||
EOF
|
||||
requests = []
|
||||
received_mail = nil
|
||||
start_server do
|
||||
sock = server.accept
|
||||
begin
|
||||
|
|
|
@ -190,7 +190,7 @@ module Net
|
|||
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
|
||||
|
|
|
@ -224,7 +224,7 @@ class TestRDocServlet < RDoc::TestCase
|
|||
|
||||
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
|
||||
|
||||
|
|
|
@ -10,7 +10,6 @@ class TestBignum < Test::Unit::TestCase
|
|||
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
|
|||
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
|
||||
|
|
|
@ -683,7 +683,6 @@ class TestFileExhaustive < Test::Unit::TestCase
|
|||
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)
|
||||
|
|
|
@ -52,7 +52,6 @@ class TestNumeric < Test::Unit::TestCase
|
|||
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
|
||||
|
|
|
@ -2362,7 +2362,6 @@ EOS
|
|||
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
|
||||
|
|
|
@ -188,7 +188,7 @@ class TestSystem < Test::Unit::TestCase
|
|||
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
|
|||
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
|
||||
|
|
|
@ -474,7 +474,7 @@ class TestThreadQueue < Test::Unit::TestCase
|
|||
prod_threads.each{|t|
|
||||
begin
|
||||
t.join
|
||||
rescue => e
|
||||
rescue
|
||||
end
|
||||
}
|
||||
end
|
||||
|
|
|
@ -185,11 +185,11 @@ class TestSocketNonblock < Test::Unit::TestCase
|
|||
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)
|
||||
|
|
|
@ -77,7 +77,7 @@ class TestOpen3 < Test::Unit::TestCase
|
|||
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
|
||||
|
|
|
@ -74,7 +74,7 @@ class TestPrime < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
def test_new
|
||||
exception = assert_raise(NoMethodError) { Prime.new }
|
||||
assert_raise(NoMethodError) { Prime.new }
|
||||
end
|
||||
|
||||
def test_enumerator_succ
|
||||
|
|
|
@ -25,9 +25,8 @@ end
|
|||
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)
|
|||
$SAFE=1
|
||||
str = 'ConnectionEvents'
|
||||
str.taint
|
||||
ev = WIN32OLE_EVENT.new(@db, str)
|
||||
WIN32OLE_EVENT.new(@db, str)
|
||||
}
|
||||
exc = assert_raise(SecurityError) {
|
||||
th.join
|
||||
|
|
Loading…
Reference in a new issue