diff options
Diffstat (limited to 'test/stringio')
-rw-r--r-- | test/stringio/test_stringio.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/stringio/test_stringio.rb b/test/stringio/test_stringio.rb index 89da34e4ec..b508d56310 100644 --- a/test/stringio/test_stringio.rb +++ b/test/stringio/test_stringio.rb @@ -452,6 +452,10 @@ class TestStringIO < Test::Unit::TestCase t.ungetbyte("\u{30eb 30d3 30fc}") assert_equal(0, t.pos) assert_equal("\u{30eb 30d3 30fc}\u7d05\u7389bar\n", s) + + assert_raise(RangeError) {t.ungetbyte(-1)} + assert_raise(RangeError) {t.ungetbyte(256)} + assert_raise(RangeError) {t.ungetbyte(1<<64)} end def test_ungetc |