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
|
extend DifferentOFS
|
||||||
|
|
||||||
def test_filter
|
def test_filter
|
||||||
rows = [[1, 2, 3], [4, 5]]
|
|
||||||
input = <<-CSV
|
input = <<-CSV
|
||||||
1;2;3
|
1;2;3
|
||||||
4;5
|
4;5
|
||||||
|
|
|
@ -641,7 +641,7 @@ EOF
|
||||||
|
|
||||||
begin
|
begin
|
||||||
imap = Net::IMAP.new(server_addr, :port => port)
|
imap = Net::IMAP.new(server_addr, :port => port)
|
||||||
resp = imap.append("INBOX", mail)
|
imap.append("INBOX", mail)
|
||||||
assert_equal(1, requests.length)
|
assert_equal(1, requests.length)
|
||||||
assert_equal("RUBY0001 APPEND INBOX {#{mail.size}}\r\n", requests[0])
|
assert_equal("RUBY0001 APPEND INBOX {#{mail.size}}\r\n", requests[0])
|
||||||
assert_equal(mail, received_mail)
|
assert_equal(mail, received_mail)
|
||||||
|
@ -664,7 +664,6 @@ Subject: hello
|
||||||
hello world
|
hello world
|
||||||
EOF
|
EOF
|
||||||
requests = []
|
requests = []
|
||||||
received_mail = nil
|
|
||||||
start_server do
|
start_server do
|
||||||
sock = server.accept
|
sock = server.accept
|
||||||
begin
|
begin
|
||||||
|
|
|
@ -190,7 +190,7 @@ module Net
|
||||||
loop do
|
loop do
|
||||||
readable, = IO.select(servers.map(&:to_io))
|
readable, = IO.select(servers.map(&:to_io))
|
||||||
readable.each do |r|
|
readable.each do |r|
|
||||||
sock, addr = r.accept_nonblock(exception: false)
|
sock, = r.accept_nonblock(exception: false)
|
||||||
next if sock == :wait_readable
|
next if sock == :wait_readable
|
||||||
return sock
|
return sock
|
||||||
end
|
end
|
||||||
|
|
|
@ -224,7 +224,7 @@ class TestRDocServlet < RDoc::TestCase
|
||||||
|
|
||||||
generator = @s.generator_for store
|
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
|
@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']
|
FIXNUM_MAX = RbConfig::LIMITS['FIXNUM_MAX']
|
||||||
|
|
||||||
BIGNUM_MIN = FIXNUM_MAX + 1
|
BIGNUM_MIN = FIXNUM_MAX + 1
|
||||||
b = BIGNUM_MIN
|
|
||||||
|
|
||||||
f = BIGNUM_MIN
|
f = BIGNUM_MIN
|
||||||
n = 0
|
n = 0
|
||||||
|
@ -612,7 +611,6 @@ class TestBignum < Test::Unit::TestCase
|
||||||
return # GMP doesn't support interrupt during an operation.
|
return # GMP doesn't support interrupt during an operation.
|
||||||
end
|
end
|
||||||
time = Time.now
|
time = Time.now
|
||||||
start_flag = false
|
|
||||||
end_flag = false
|
end_flag = false
|
||||||
num = (65536 ** 65536)
|
num = (65536 ** 65536)
|
||||||
q = Queue.new
|
q = Queue.new
|
||||||
|
|
|
@ -683,7 +683,6 @@ class TestFileExhaustive < Test::Unit::TestCase
|
||||||
def test_utime_symlinkfile
|
def test_utime_symlinkfile
|
||||||
return unless symlinkfile
|
return unless symlinkfile
|
||||||
t = Time.local(2000)
|
t = Time.local(2000)
|
||||||
stat = File.lstat(symlinkfile)
|
|
||||||
assert_equal(1, File.utime(t, t, symlinkfile))
|
assert_equal(1, File.utime(t, t, symlinkfile))
|
||||||
assert_equal(t, File.stat(regular_file).atime)
|
assert_equal(t, File.stat(regular_file).atime)
|
||||||
assert_equal(t, File.stat(regular_file).mtime)
|
assert_equal(t, File.stat(regular_file).mtime)
|
||||||
|
|
|
@ -52,7 +52,6 @@ class TestNumeric < Test::Unit::TestCase
|
||||||
end.new
|
end.new
|
||||||
assert_equal(-1, -a)
|
assert_equal(-1, -a)
|
||||||
|
|
||||||
bug7688 = '[ruby-core:51389] [Bug #7688]'
|
|
||||||
a = Class.new(Numeric) do
|
a = Class.new(Numeric) do
|
||||||
def coerce(x); raise StandardError, "my error"; end
|
def coerce(x); raise StandardError, "my error"; end
|
||||||
end.new
|
end.new
|
||||||
|
|
|
@ -2362,7 +2362,6 @@ EOS
|
||||||
w.syswrite("exec failed\n")
|
w.syswrite("exec failed\n")
|
||||||
end
|
end
|
||||||
q = Queue.new
|
q = Queue.new
|
||||||
run = true
|
|
||||||
th1 = Thread.new { i = 0; i += 1 while q.empty?; i }
|
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 }
|
th2 = Thread.new { j = 0; j += 1 while q.empty? && Thread.pass.nil?; j }
|
||||||
sleep 0.5
|
sleep 0.5
|
||||||
|
|
|
@ -188,7 +188,7 @@ class TestSystem < Test::Unit::TestCase
|
||||||
name = "\u{30c6 30b9 30c8}"
|
name = "\u{30c6 30b9 30c8}"
|
||||||
tmpfilename = "#{tmpdir}/#{name}.cmd"
|
tmpfilename = "#{tmpdir}/#{name}.cmd"
|
||||||
message = /#{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)
|
system(tmpfilename, exception: true)
|
||||||
end
|
end
|
||||||
open(tmpfilename, "w") {|f|
|
open(tmpfilename, "w") {|f|
|
||||||
|
@ -196,7 +196,7 @@ class TestSystem < Test::Unit::TestCase
|
||||||
f.puts "exit 127"
|
f.puts "exit 127"
|
||||||
f.chmod(0755)
|
f.chmod(0755)
|
||||||
}
|
}
|
||||||
e = assert_raise_with_message(RuntimeError, message) do
|
assert_raise_with_message(RuntimeError, message) do
|
||||||
system(tmpfilename, exception: true)
|
system(tmpfilename, exception: true)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -474,7 +474,7 @@ class TestThreadQueue < Test::Unit::TestCase
|
||||||
prod_threads.each{|t|
|
prod_threads.each{|t|
|
||||||
begin
|
begin
|
||||||
t.join
|
t.join
|
||||||
rescue => e
|
rescue
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
|
@ -185,11 +185,11 @@ class TestSocketNonblock < Test::Unit::TestCase
|
||||||
def udp_pair
|
def udp_pair
|
||||||
s1 = UDPSocket.new
|
s1 = UDPSocket.new
|
||||||
s1.bind('127.0.0.1', 0)
|
s1.bind('127.0.0.1', 0)
|
||||||
af, port1, host, addr1 = s1.addr
|
_, port1, _, addr1 = s1.addr
|
||||||
|
|
||||||
s2 = UDPSocket.new
|
s2 = UDPSocket.new
|
||||||
s2.bind('127.0.0.1', 0)
|
s2.bind('127.0.0.1', 0)
|
||||||
af, port2, host, addr2 = s2.addr
|
_, port2, _, addr2 = s2.addr
|
||||||
|
|
||||||
s1.connect(addr2, port2)
|
s1.connect(addr2, port2)
|
||||||
s2.connect(addr1, port1)
|
s2.connect(addr1, port1)
|
||||||
|
|
|
@ -77,7 +77,7 @@ class TestOpen3 < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_env
|
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
|
output = out.read
|
||||||
assert_equal("\"B\"\n", output)
|
assert_equal("\"B\"\n", output)
|
||||||
end
|
end
|
||||||
|
|
|
@ -74,7 +74,7 @@ class TestPrime < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_new
|
def test_new
|
||||||
exception = assert_raise(NoMethodError) { Prime.new }
|
assert_raise(NoMethodError) { Prime.new }
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_enumerator_succ
|
def test_enumerator_succ
|
||||||
|
|
|
@ -25,9 +25,8 @@ end
|
||||||
def swbemsink_available?
|
def swbemsink_available?
|
||||||
available = false
|
available = false
|
||||||
if defined?(WIN32OLE)
|
if defined?(WIN32OLE)
|
||||||
wmi = nil
|
|
||||||
begin
|
begin
|
||||||
wmi = WIN32OLE.new('WbemScripting.SWbemSink')
|
WIN32OLE.new('WbemScripting.SWbemSink')
|
||||||
available = true
|
available = true
|
||||||
rescue
|
rescue
|
||||||
end
|
end
|
||||||
|
@ -422,7 +421,7 @@ if defined?(WIN32OLE_EVENT)
|
||||||
$SAFE=1
|
$SAFE=1
|
||||||
str = 'ConnectionEvents'
|
str = 'ConnectionEvents'
|
||||||
str.taint
|
str.taint
|
||||||
ev = WIN32OLE_EVENT.new(@db, str)
|
WIN32OLE_EVENT.new(@db, str)
|
||||||
}
|
}
|
||||||
exc = assert_raise(SecurityError) {
|
exc = assert_raise(SecurityError) {
|
||||||
th.join
|
th.join
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue