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

ruby-changes:15829

From: akr <ko1@a...>
Date: Wed, 12 May 2010 23:16:23 +0900 (JST)
Subject: [ruby-changes:15829] Ruby:r27762 (trunk): add a test.

akr	2010-05-12 23:16:13 +0900 (Wed, 12 May 2010)

  New Revision: 27762

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

  Log:
    add a test.

  Modified files:
    trunk/test/ruby/test_io_m17n.rb

Index: test/ruby/test_io_m17n.rb
===================================================================
--- test/ruby/test_io_m17n.rb	(revision 27761)
+++ test/ruby/test_io_m17n.rb	(revision 27762)
@@ -1774,15 +1774,22 @@
     }
   end
 
-
   def test_cbuf_select
-    with_tmpdir {
-      r, w = IO.pipe
-      w << "\r\n"
-      r.set_encoding("US-ASCII:UTF-8", :universal_newline => true)
-      r.ungetc(r.getc)
-      assert_equal([[r],[],[]], IO.select([r], nil, nil, 1))
-    }
+    r, w = IO.pipe
+    w << "\r\n"
+    r.set_encoding("US-ASCII:UTF-8", :universal_newline => true)
+    r.ungetc(r.getc)
+    assert_equal([[r],[],[]], IO.select([r], nil, nil, 1))
   end
+
+  def test_textmode_paragraphmode
+    r, w = IO.pipe
+    w << "a\n\n\nc".gsub(/\n/, "\r\n")
+    w.close
+    r.set_encoding("US-ASCII:UTF-8", :universal_newline => true)
+    assert_equal("a\n\n", r.gets(""))
+    assert_equal("c", r.gets(""), "[ruby-core:23723] (18)")
+  end
+
 end
 

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

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