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:
parent
f211abcb9c
commit
07f53e4830
1 changed files with 10 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue