summaryrefslogtreecommitdiff
path: root/test/stringio
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-18 03:05:53 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-18 03:05:53 +0000
commit07f53e483042f8d154912b9414808ad40973cd44 (patch)
tree8bcf1bef5bc53e8ffa16625c8e0db3a0ed33b5ad /test/stringio
parentf211abcb9c8c82c2e70d3d20ad40883ce446d0ac (diff)
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
Diffstat (limited to 'test/stringio')
-rw-r--r--test/stringio/test_stringio.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/stringio/test_stringio.rb b/test/stringio/test_stringio.rb
index 17ae9ab..af6efc6 100644
--- a/test/stringio/test_stringio.rb
+++ b/test/stringio/test_stringio.rb
@@ -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