ruby-changes:40858
From: ngoto <ko1@a...>
Date: Tue, 8 Dec 2015 13:04:10 +0900 (JST)
Subject: [ruby-changes:40858] ngoto:r52937 (trunk): * test/io/console/test_io_console.rb (test_getpass): s.getpass
ngoto 2015-12-08 13:03:53 +0900 (Tue, 08 Dec 2015) New Revision: 52937 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=52937 Log: * test/io/console/test_io_console.rb (test_getpass): s.getpass should be tested. Narrow ensure block. This reverts r52911. [Bug #11780] [ruby-dev:49412] Modified files: trunk/ChangeLog trunk/test/io/console/test_io_console.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 52936) +++ ChangeLog (revision 52937) @@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Tue Dec 8 12:58:04 2015 Naohisa Goto <ngotogenome@g...> + + * test/io/console/test_io_console.rb (test_getpass): s.getpass + should be tested. Narrow ensure block. This reverts r52911. + [Bug #11780] [ruby-dev:49412] + Tue Dec 8 10:40:21 2015 Eric Wong <e@8...> * benchmark/bm_vm2_case_lit.rb: new benchmark Index: test/io/console/test_io_console.rb =================================================================== --- test/io/console/test_io_console.rb (revision 52936) +++ test/io/console/test_io_console.rb (revision 52937) @@ -181,18 +181,18 @@ class TestIO_Console < Test::Unit::TestC https://github.com/ruby/ruby/blob/trunk/test/io/console/test_io_console.rb#L181 end def test_getpass - th = nil helper {|m, s| - th = Thread.start { - sleep 0.1 - s.print "asdf\n" - } - assert_equal("asdf", m.getpass) - assert_equal("\n", s.readpartial(2)) - th.join + begin + th = Thread.start { + sleep 0.1 + m.print "asdf\n" + } + assert_equal("asdf", s.getpass("> ")) + assert_equal("> \r\n", m.readpartial(10)) + ensure + th.join rescue nil + end } - ensure - th.join rescue nil end def test_iflush -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/