ruby-changes:16969
From: akr <ko1@a...>
Date: Thu, 12 Aug 2010 00:21:24 +0900 (JST)
Subject: [ruby-changes:16969] Ruby:r28965 (trunk): * test/ruby/test_rubyoptions.rb (test_script_from_stdin): disable
akr 2010-08-12 00:21:09 +0900 (Thu, 12 Aug 2010) New Revision: 28965 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=28965 Log: * test/ruby/test_rubyoptions.rb (test_script_from_stdin): disable echo. [ruby-dev:41966] Modified files: trunk/ChangeLog trunk/test/ruby/test_rubyoptions.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 28964) +++ ChangeLog (revision 28965) @@ -1,3 +1,8 @@ +Thu Aug 12 00:19:53 2010 Tanaka Akira <akr@f...> + + * test/ruby/test_rubyoptions.rb (test_script_from_stdin): disable + echo. [ruby-dev:41966] + Wed Aug 11 23:28:22 2010 Kenta Murata <mrkn@m...> * lib/cmath.rb (CMath.sqrt): use floating-point value. Index: test/ruby/test_rubyoptions.rb =================================================================== --- test/ruby/test_rubyoptions.rb (revision 28964) +++ test/ruby/test_rubyoptions.rb (revision 28965) @@ -434,25 +434,30 @@ end require 'timeout' result = nil - s, w = IO.pipe - PTY.spawn(EnvUtil.rubybin, out: w) do |r, m| - w.close - m.print("\C-d") - assert_nothing_raised('[ruby-dev:37798]') do - result = Timeout.timeout(3) {s.read} - end - end - s.close + IO.pipe {|r, w| + PTY.open {|m, s| + m.echo = false + m.print("\C-d") + pid = spawn(EnvUtil.rubybin, :in => s, :out => w) + w.close + assert_nothing_raised('[ruby-dev:37798]') do + result = Timeout.timeout(3) {r.read} + end + Process.wait pid + } + } assert_equal("", result, '[ruby-dev:37798]') - s, w = IO.pipe - PTY.spawn(EnvUtil.rubybin, out: w) do |r, m| - w.close - m.print("$stdin.read; p $stdin.gets\n\C-d") - m.print("abc\n\C-d") - m.print("zzz\n") - result = s.read - end - s.close + IO.pipe {|r, w| + PTY.open {|m, s| + m.echo = false + pid = spawn(EnvUtil.rubybin, :in => s, :out => w) + w.close + m.print("$stdin.read; p $stdin.gets\n\C-d") + m.print("abc\n\C-d") + m.print("zzz\n") + result = r.read + } + } assert_equal("\"zzz\\n\"\n", result, '[ruby-core:30910]') end end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/