aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-21 03:15:57 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-21 03:15:57 +0000
commitbd8597a9993491479d2e03a4ded55e864b2225b4 (patch)
tree89c8a73a702739d419e34a69fc14b99644afa4b6 /test
parentda2e7c0c6c63bfb549322c7af2d43154dfc52cfb (diff)
downloadruby-bd8597a9993491479d2e03a4ded55e864b2225b4.tar.gz
stringio.c: check range
* ext/stringio/stringio.c (strio_ungetc): raise RangeError instead of TypeError at too big value, as well as IO#ungetc. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58041 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/stringio/test_stringio.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/test/stringio/test_stringio.rb b/test/stringio/test_stringio.rb
index 30370f5ca6..667fe3ea81 100644
--- a/test/stringio/test_stringio.rb
+++ b/test/stringio/test_stringio.rb
@@ -455,6 +455,7 @@ class TestStringIO < Test::Unit::TestCase
assert_equal("2", f.getc)
assert_raise(RangeError) {f.ungetc(0x1ffffff)}
+ assert_raise(RangeError) {f.ungetc(0xffffffffffffff)}
ensure
f.close unless f.closed?
end