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

ruby-changes:22219

From: nagachika <ko1@a...>
Date: Wed, 11 Jan 2012 22:46:41 +0900 (JST)
Subject: [ruby-changes:22219] nagachika:r34268 (trunk): * test/readline/test_readline.rb (test_completion_proc_empty_result):

nagachika	2012-01-11 22:46:32 +0900 (Wed, 11 Jan 2012)

  New Revision: 34268

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

  Log:
    * test/readline/test_readline.rb (test_completion_proc_empty_result):
      ensure clearance of Readline's line_buffer after the test.

  Modified files:
    trunk/ChangeLog
    trunk/test/readline/test_readline.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 34267)
+++ ChangeLog	(revision 34268)
@@ -1,3 +1,8 @@
+Wed Jan 11 22:36:43 2012  CHIKANAGA Tomoyuki  <nagachika00@g...>
+
+	* test/readline/test_readline.rb (test_completion_proc_empty_result):
+	  ensure clearance of Readline's line_buffer after the test.
+
 Tue Jan 10 21:57:38 2012  Hiroshi Shirosaki <h.shirosaki@g...>
 
 	* ext/dbm/dbm.c (Init_dbm): fix a build error on mswin32.
Index: test/readline/test_readline.rb
===================================================================
--- test/readline/test_readline.rb	(revision 34267)
+++ test/readline/test_readline.rb	(revision 34268)
@@ -208,11 +208,19 @@
       stdin.write("first\t")
       stdin.flush
       Readline.completion_proc = ->(text) {[]}
-      line = nil
+      line1 = line2 = nil
       replace_stdio(stdin.path, stdout.path) {
-        assert_nothing_raised(NoMemoryError) {line = Readline.readline("> ")}
+        assert_nothing_raised(NoMemoryError) {line1 = Readline.readline("> ")}
+        stdin.write("\n")
+        stdin.flush
+        assert_nothing_raised(NoMemoryError) {line2 = Readline.readline("> ")}
       }
-      assert_equal("first", line)
+      assert_equal("first", line1)
+      assert_equal("", line2)
+      begin
+        assert_equal("", Readline.line_buffer)
+      rescue NotimplementedError
+      end
     end
   end
 

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

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