ruby-changes:24081
From: naruse <ko1@a...>
Date: Tue, 19 Jun 2012 13:15:47 +0900 (JST)
Subject: [ruby-changes:24081] naruse:r36132 (trunk): Add test for [Bug #6262]
naruse 2012-06-19 13:15:37 +0900 (Tue, 19 Jun 2012) New Revision: 36132 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=36132 Log: Add test for [Bug #6262] Modified files: trunk/test/readline/test_readline.rb Index: test/readline/test_readline.rb =================================================================== --- test/readline/test_readline.rb (revision 36131) +++ test/readline/test_readline.rb (revision 36132) @@ -414,6 +414,28 @@ Readline::HISTORY.clear end if !/EditLine/n.match(Readline::VERSION) + def test_input_metachar_multibyte + bug6602 = '[ruby-core:45683]' + Readline::HISTORY << "\u3042\u3093" + Readline::HISTORY << "\u3044\u3093" + Readline::HISTORY << "\u3046\u3093" + open(IO::NULL, 'w') do |null| + IO.pipe do |r, w| + Readline.input = r + Readline.output = null + w << "\cr\u3093\n\n" + w << "\cr\u3042\u3093" + w.reopen(IO::NULL) + assert_equal("\u3046\u3093", Readline.readline("", true), bug6602) + assert_equal("\u3042\u3093", Readline.readline("", true), bug6602) + assert_equal(nil, Readline.readline("", true), bug6602) + end + end + ensure + with_pipe {|r, w| w.write("\C-a\C-k\n")} # clear line_buffer + Readline::HISTORY.clear + end if !/EditLine/n.match(Readline::VERSION) + private def replace_stdio(stdin_path, stdout_path) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/