Project

General

Profile

Bug #7232 ยป patch.diff

Glass_saga (Masaki Matsushita), 12/25/2012 01:16 PM

View differences:

ext/stringio/stringio.c
958 958

  
959 959
      case 2:
960 960
	if (!NIL_P(str)) StringValue(str);
961
	limit = NUM2LONG(lim);
961
	if (!NIL_P(lim)) limit = NUM2LONG(lim);
962 962
	break;
963 963
    }
964 964

  
test/stringio/test_stringio.rb
52 52
    assert_equal("abc\n\ndef\n", StringIO.new("abc\n\ndef\n").gets(nil))
53 53
    assert_equal("abc\n\n", StringIO.new("abc\n\ndef\n").gets(""))
54 54
    assert_raise(TypeError){StringIO.new("").gets(1, 1)}
55
    assert_raise(TypeError){StringIO.new("").gets(nil, nil)}
55
    assert_nothing_raised {StringIO.new("").gets(nil, nil)}
56 56
  end
57 57

  
58 58
  def test_readlines