[前][次][番号順一覧][スレッド一覧]

ruby-changes:41105

From: nobu <ko1@a...>
Date: Fri, 18 Dec 2015 12:06:02 +0900 (JST)
Subject: [ruby-changes:41105] nobu:r53180 (trunk): test_stringio.rb: add test

nobu	2015-12-18 12:05:53 +0900 (Fri, 18 Dec 2015)

  New Revision: 53180

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=53180

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

  Modified files:
    trunk/test/stringio/test_stringio.rb
Index: test/stringio/test_stringio.rb
===================================================================
--- test/stringio/test_stringio.rb	(revision 53179)
+++ test/stringio/test_stringio.rb	(revision 53180)
@@ -572,6 +572,16 @@ class TestStringIO < Test::Unit::TestCas https://github.com/ruby/ruby/blob/trunk/test/stringio/test_stringio.rb#L572
     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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]