1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

test_stringio.rb: add test

* test/stringio/test_stringio.rb (test_ungetc_pos): add a test for
  r26588.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53180 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2015-12-18 03:05:53 +00:00
parent f211abcb9c
commit 07f53e4830

View file

@ -572,6 +572,16 @@ class TestStringIO < Test::Unit::TestCase
end
end
def test_ungetc_padding
s = StringIO.new()
s.pos = 2
s.ungetc("a")
assert_equal("\0""a", s.string)
s.pos = 0
s.ungetc("b")
assert_equal("b""\0""a", s.string)
end
def test_frozen
s = StringIO.new
s.freeze