diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-03-04 13:55:24 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-03-04 13:55:24 +0000 |
commit | 0562c4f76d89cfc9d7c95d077fa62652bbe54664 (patch) | |
tree | abdd3147214bf536da428ba87319aec50c6ef594 /test | |
parent | de1f3c92e701cdb2752f5079107ad65512e1b43b (diff) | |
download | ruby-0562c4f76d89cfc9d7c95d077fa62652bbe54664.tar.gz |
* test/ruby: get rid of warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45267 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_defined.rb | 2 | ||||
-rw-r--r-- | test/ruby/test_enum.rb | 2 | ||||
-rw-r--r-- | test/ruby/test_exception.rb | 7 | ||||
-rw-r--r-- | test/ruby/test_fiber.rb | 6 | ||||
-rw-r--r-- | test/ruby/test_float.rb | 12 | ||||
-rw-r--r-- | test/ruby/test_io.rb | 4 | ||||
-rw-r--r-- | test/ruby/test_iseq.rb | 2 |
7 files changed, 17 insertions, 18 deletions
diff --git a/test/ruby/test_defined.rb b/test/ruby/test_defined.rb index 6c63c7fb27..657f7934f8 100644 --- a/test/ruby/test_defined.rb +++ b/test/ruby/test_defined.rb @@ -203,7 +203,7 @@ class TestDefined < Test::Unit::TestCase o = c.new o.extend(m) - assert_equal("super", o.x) + assert_equal("super", o.x, bug8367) end def test_super_toplevel diff --git a/test/ruby/test_enum.rb b/test/ruby/test_enum.rb index 20800cdd61..beddb817cd 100644 --- a/test/ruby/test_enum.rb +++ b/test/ruby/test_enum.rb @@ -106,7 +106,7 @@ class TestEnumerable < Test::Unit::TestCase def test_to_h obj = Object.new def obj.each(*args) - yield *args + yield(*args) yield [:key, :value] yield :other_key, :other_value kvp = Object.new diff --git a/test/ruby/test_exception.rb b/test/ruby/test_exception.rb index aabe1464b1..f3afd674ab 100644 --- a/test/ruby/test_exception.rb +++ b/test/ruby/test_exception.rb @@ -523,9 +523,9 @@ end.join assert_equal(false, s.tainted?) end - def m; - m &->{return 0}; - 42; + def m + m(&->{return 0}) + 42 end def test_stackoverflow @@ -573,7 +573,6 @@ end.join def test_cause_reraised msg = "[Feature #8257]" - cause = nil e = assert_raise(RuntimeError) { begin raise msg diff --git a/test/ruby/test_fiber.rb b/test/ruby/test_fiber.rb index 3f620c69f8..ed071acb39 100644 --- a/test/ruby/test_fiber.rb +++ b/test/ruby/test_fiber.rb @@ -219,8 +219,8 @@ class TestFiber < Test::Unit::TestCase def test_no_valid_cfp bug5083 = '[ruby-dev:44208]' - assert_equal([], Fiber.new(&Module.method(:nesting)).resume) - assert_instance_of(Class, Fiber.new(&Class.new.method(:undef_method)).resume(:to_s)) + assert_equal([], Fiber.new(&Module.method(:nesting)).resume, bug5083) + assert_instance_of(Class, Fiber.new(&Class.new.method(:undef_method)).resume(:to_s), bug5083) end def test_prohibit_resume_transfered_fiber @@ -283,7 +283,7 @@ class TestFiber < Test::Unit::TestCase env = {} env['RUBY_FIBER_VM_STACK_SIZE'] = vm_stack_size.to_s if vm_stack_size env['RUBY_FIBER_MACHINE_STACK_SIZE'] = machine_stack_size.to_s if machine_stack_size - out, err = Dir.mktmpdir("test_fiber") {|tmpdir| + out, _ = Dir.mktmpdir("test_fiber") {|tmpdir| EnvUtil.invoke_ruby([env, '-e', script], '', true, true, chdir: tmpdir) } use_length ? out.length : out diff --git a/test/ruby/test_float.rb b/test/ruby/test_float.rb index b8b4da6f43..3ee0a23a63 100644 --- a/test/ruby/test_float.rb +++ b/test/ruby/test_float.rb @@ -248,14 +248,14 @@ class TestFloat < Test::Unit::TestCase def test_modulo3 bug6048 = '[ruby-core:42726]' - assert_equal(4.2, 4.2.send(:%, Float::INFINITY)) - assert_equal(4.2, 4.2 % Float::INFINITY) + assert_equal(4.2, 4.2.send(:%, Float::INFINITY), bug6048) + assert_equal(4.2, 4.2 % Float::INFINITY, bug6048) assert_is_minus_zero(-0.0 % 4.2) assert_is_minus_zero(-0.0.send :%, 4.2) - assert_raise(ZeroDivisionError) { 4.2.send(:%, 0.0) } - assert_raise(ZeroDivisionError) { 4.2 % 0.0 } - assert_raise(ZeroDivisionError) { 42.send(:%, 0) } - assert_raise(ZeroDivisionError) { 42 % 0 } + assert_raise(ZeroDivisionError, bug6048) { 4.2.send(:%, 0.0) } + assert_raise(ZeroDivisionError, bug6048) { 4.2 % 0.0 } + assert_raise(ZeroDivisionError, bug6048) { 42.send(:%, 0) } + assert_raise(ZeroDivisionError, bug6048) { 42 % 0 } end def test_divmod2 diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index a6f2b14abe..b375754878 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -1643,7 +1643,7 @@ class TestIO < Test::Unit::TestCase end def test_pos_with_getc - bug6179 = '[ruby-core:43497]' + _bug6179 = '[ruby-core:43497]' make_tempfile {|t| ["", "t", "b"].each do |mode| open(t.path, "w#{mode}") do |f| @@ -1699,7 +1699,7 @@ class TestIO < Test::Unit::TestCase end if defined?(IO::SEEK_HOLE) - open(t.path) { |f|2 + open(t.path) { |f| assert_equal("foo\n", f.gets) f.seek(0, IO::SEEK_HOLE) assert_equal("", f.read) diff --git a/test/ruby/test_iseq.rb b/test/ruby/test_iseq.rb index 4e3f6c1926..94a814ce1b 100644 --- a/test/ruby/test_iseq.rb +++ b/test/ruby/test_iseq.rb @@ -11,7 +11,7 @@ class TestISeq < Test::Unit::TestCase def lines src body = RubyVM::InstructionSequence.new(src).to_a[13] - lines = body.find_all{|e| e.kind_of? Fixnum} + body.find_all{|e| e.kind_of? Fixnum} end def test_to_a_lines |