From a967f738c83b960f23f5b04403a17ca37f049e25 Mon Sep 17 00:00:00 2001 From: akr Date: Mon, 25 Jan 2010 22:08:29 +0000 Subject: * lib/matrix.rb: suppress warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/fileutils/test_dryrun.rb | 2 +- test/fileutils/test_fileutils.rb | 2 +- test/ruby/test_case.rb | 4 ++-- test/ruby/test_rubyoptions.rb | 6 +++++- test/ruby/test_transcode.rb | 2 +- test/socket/test_unix.rb | 2 +- 6 files changed, 11 insertions(+), 7 deletions(-) (limited to 'test') diff --git a/test/fileutils/test_dryrun.rb b/test/fileutils/test_dryrun.rb index 2fdd65d2f6..e5ca25c9b4 100644 --- a/test/fileutils/test_dryrun.rb +++ b/test/fileutils/test_dryrun.rb @@ -15,7 +15,7 @@ class TestFileUtilsDryRun < Test::Unit::TestCase "FileUtils::DryRun.#{m} not public" end FileUtils::METHODS.each do |m| - assert_equal true, respond_to?(m, true) + assert_equal true, respond_to?(m, true), "FileUtils::DryRun\##{m} is not defined" assert_equal true, FileUtils::DryRun.private_method_defined?(m), "FileUtils::DryRun\##{m} is not private" diff --git a/test/fileutils/test_fileutils.rb b/test/fileutils/test_fileutils.rb index dfbeec5b20..048d255c60 100644 --- a/test/fileutils/test_fileutils.rb +++ b/test/fileutils/test_fileutils.rb @@ -726,7 +726,7 @@ class TestFileUtils Dir.rmdir "tmp-first-line\ntmp-second-line" end if lf_in_path_allowed? - def test_mkdir_pathname + def test_mkdir_pathname # pathname assert_nothing_raised { mkdir Pathname.new('tmp/tmpdirtmp') diff --git a/test/ruby/test_case.rb b/test/ruby/test_case.rb index f9f16d55a2..c4938ee55a 100644 --- a/test/ruby/test_case.rb +++ b/test/ruby/test_case.rb @@ -57,11 +57,11 @@ class TestCase < Test::Unit::TestCase def test_deoptimization assert_in_out_err(['-e', <<-EOS], '', %w[42], []) - class Symbol; def ===(o); p 42; true; end; end; case :foo; when :foo; end + class Symbol; undef ===; def ===(o); p 42; true; end; end; case :foo; when :foo; end EOS assert_in_out_err(['-e', <<-EOS], '', %w[42], []) - class Fixnum; def ===(o); p 42; true; end; end; case 1; when 1; end + class Fixnum; undef ===; def ===(o); p 42; true; end; end; case 1; when 1; end EOS end end diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb index f1897c5d0b..771d7cdfff 100644 --- a/test/ruby/test_rubyoptions.rb +++ b/test/ruby/test_rubyoptions.rb @@ -38,10 +38,14 @@ class TestRubyOptions < Test::Unit::TestCase end def test_warning + save_rubyopt = ENV['RUBYOPT'] + ENV['RUBYOPT'] = nil assert_in_out_err(%w(-W0 -e) + ['p $-W'], "", %w(0), []) assert_in_out_err(%w(-W1 -e) + ['p $-W'], "", %w(1), []) assert_in_out_err(%w(-Wx -e) + ['p $-W'], "", %w(1), []) assert_in_out_err(%w(-W -e) + ['p $-W'], "", %w(2), []) + ensure + ENV['RUBYOPT'] = save_rubyopt end def test_safe_level @@ -271,7 +275,7 @@ class TestRubyOptions < Test::Unit::TestCase def test_sflag assert_in_out_err(%w(- -abc -def=foo -ghi-jkl -- -xyz), - "#!ruby -s\np [$abc, $def, $ghi_jkl, $xyz]\n", + "#!ruby -s\np [$abc, $def, $ghi_jkl, defined?($xyz)]\n", ['[true, "foo", true, nil]'], []) assert_in_out_err(%w(- -#), "#!ruby -s\n", [], diff --git a/test/ruby/test_transcode.rb b/test/ruby/test_transcode.rb index 9d4305876f..bca51ba251 100644 --- a/test/ruby/test_transcode.rb +++ b/test/ruby/test_transcode.rb @@ -909,7 +909,7 @@ class TestTranscode < Test::Unit::TestCase assert_raise(Encoding::UndefinedConversionError) { "\xFF".encode("utf-8", 'TIS-620') } end - def test_CP850 + def test_CP850 check_both_ways("\u00C7", "\x80", 'CP850') # Ç check_both_ways("\u00C5", "\x8F", 'CP850') # Å check_both_ways("\u00C9", "\x90", 'CP850') # É diff --git a/test/socket/test_unix.rb b/test/socket/test_unix.rb index e18f5d6e95..d8cf7139e9 100644 --- a/test/socket/test_unix.rb +++ b/test/socket/test_unix.rb @@ -43,7 +43,7 @@ class TestSocket_UNIXSocket < Test::Unit::TestCase UNIXSocket.pair {|s1, s2| begin ret = s1.sendmsg("\0", 0, nil, [Socket::SOL_SOCKET, Socket::SCM_RIGHTS, - send_io_ary.map {|io| io.fileno }.pack("i!*")]) + send_io_ary.map {|io2| io2.fileno }.pack("i!*")]) rescue NotImplementedError return end -- cgit v1.2.3