mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	* test/ruby: get rid of warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45267 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
		
							parent
							
								
									de1f3c92e7
								
							
						
					
					
						commit
						0562c4f76d
					
				
					 7 changed files with 17 additions and 18 deletions
				
			
		| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue