summaryrefslogtreecommitdiff
path: root/test/stringio
diff options
context:
space:
mode:
authorkazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-01-09 12:55:20 +0000
committerkazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-01-09 12:55:20 +0000
commit730f2886b535709832494ebe8c98f88ba0a29cea (patch)
treed751bf63f4df33521833972e227a422f1d28bf00 /test/stringio
parentbc27f87889934099f1b8b17512c634b615062e22 (diff)
Follow behaviour of IO#ungetbyte
see r65802 and [Bug #14359] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66760 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/stringio')
-rw-r--r--test/stringio/test_stringio.rb4
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