diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-18 03:05:53 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-18 03:05:53 +0000 |
commit | e735475f54eb9ce035b7d8acef901c0bd7a4b483 (patch) | |
tree | 8bcf1bef5bc53e8ffa16625c8e0db3a0ed33b5ad | |
parent | e342f36d95610747ce5db57ae2ceb0169c884c18 (diff) | |
download | ruby-e735475f54eb9ce035b7d8acef901c0bd7a4b483.tar.gz |
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
-rw-r--r-- | test/stringio/test_stringio.rb | 10 |
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 |