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

ruby-changes:33188

From: usa <ko1@a...>
Date: Tue, 4 Mar 2014 22:55:29 +0900 (JST)
Subject: [ruby-changes:33188] usa:r45267 (trunk): * test/ruby: get rid of warnings.

usa	2014-03-04 22:55:24 +0900 (Tue, 04 Mar 2014)

  New Revision: 45267

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=45267

  Log:
    * test/ruby: get rid of warnings.

  Modified files:
    trunk/test/ruby/test_defined.rb
    trunk/test/ruby/test_enum.rb
    trunk/test/ruby/test_exception.rb
    trunk/test/ruby/test_fiber.rb
    trunk/test/ruby/test_float.rb
    trunk/test/ruby/test_io.rb
    trunk/test/ruby/test_iseq.rb
Index: test/ruby/test_fiber.rb
===================================================================
--- test/ruby/test_fiber.rb	(revision 45266)
+++ test/ruby/test_fiber.rb	(revision 45267)
@@ -219,8 +219,8 @@ class TestFiber < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_fiber.rb#L219
 
   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 https://github.com/ruby/ruby/blob/trunk/test/ruby/test_fiber.rb#L283
     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
Index: test/ruby/test_enum.rb
===================================================================
--- test/ruby/test_enum.rb	(revision 45266)
+++ test/ruby/test_enum.rb	(revision 45267)
@@ -106,7 +106,7 @@ class TestEnumerable < Test::Unit::TestC https://github.com/ruby/ruby/blob/trunk/test/ruby/test_enum.rb#L106
   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
Index: test/ruby/test_float.rb
===================================================================
--- test/ruby/test_float.rb	(revision 45266)
+++ test/ruby/test_float.rb	(revision 45267)
@@ -248,14 +248,14 @@ class TestFloat < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_float.rb#L248
 
   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
Index: test/ruby/test_defined.rb
===================================================================
--- test/ruby/test_defined.rb	(revision 45266)
+++ test/ruby/test_defined.rb	(revision 45267)
@@ -203,7 +203,7 @@ class TestDefined < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_defined.rb#L203
 
     o = c.new
     o.extend(m)
-    assert_equal("super", o.x)
+    assert_equal("super", o.x, bug8367)
   end
 
   def test_super_toplevel
Index: test/ruby/test_iseq.rb
===================================================================
--- test/ruby/test_iseq.rb	(revision 45266)
+++ test/ruby/test_iseq.rb	(revision 45267)
@@ -11,7 +11,7 @@ class TestISeq < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_iseq.rb#L11
 
   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
Index: test/ruby/test_io.rb
===================================================================
--- test/ruby/test_io.rb	(revision 45266)
+++ test/ruby/test_io.rb	(revision 45267)
@@ -1643,7 +1643,7 @@ class TestIO < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_io.rb#L1643
   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 https://github.com/ruby/ruby/blob/trunk/test/ruby/test_io.rb#L1699
       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)
Index: test/ruby/test_exception.rb
===================================================================
--- test/ruby/test_exception.rb	(revision 45266)
+++ test/ruby/test_exception.rb	(revision 45267)
@@ -523,9 +523,9 @@ end.join https://github.com/ruby/ruby/blob/trunk/test/ruby/test_exception.rb#L523
     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 https://github.com/ruby/ruby/blob/trunk/test/ruby/test_exception.rb#L573
 
   def test_cause_reraised
     msg = "[Feature #8257]"
-    cause = nil
     e = assert_raise(RuntimeError) {
       begin
         raise msg

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

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