Project

General

Profile

Bug #7232 ยป patch.diff

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

View differences:

ext/stringio/stringio.c
case 2:
if (!NIL_P(str)) StringValue(str);
limit = NUM2LONG(lim);
if (!NIL_P(lim)) limit = NUM2LONG(lim);
break;
}
test/stringio/test_stringio.rb
assert_equal("abc\n\ndef\n", StringIO.new("abc\n\ndef\n").gets(nil))
assert_equal("abc\n\n", StringIO.new("abc\n\ndef\n").gets(""))
assert_raise(TypeError){StringIO.new("").gets(1, 1)}
assert_raise(TypeError){StringIO.new("").gets(nil, nil)}
assert_nothing_raised {StringIO.new("").gets(nil, nil)}
end
def test_readlines
    (1-1/1)