summaryrefslogtreecommitdiff
path: root/test/stringio
diff options
context:
space:
mode:
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 17ae9ab848..af6efc684e 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