ruby-changes:32011
From: shugo <ko1@a...>
Date: Mon, 9 Dec 2013 15:26:40 +0900 (JST)
Subject: [ruby-changes:32011] shugo:r44090 (trunk): removed.
shugo 2013-12-09 15:26:34 +0900 (Mon, 09 Dec 2013) New Revision: 44090 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=44090 Log: removed. Removed files: trunk/test/test_curses.rb Modified files: trunk/ChangeLog Index: ChangeLog =================================================================== --- ChangeLog (revision 44089) +++ ChangeLog (revision 44090) @@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Mon Dec 9 15:26:17 2013 Shugo Maeda <shugo@r...> + + * test/test_curses.rb: removed. + Mon Dec 9 13:36:55 2013 Shugo Maeda <shugo@r...> * ext/curses, sample/curses: removed curses. Index: test/test_curses.rb =================================================================== --- test/test_curses.rb (revision 44089) +++ test/test_curses.rb (revision 44090) @@ -1,74 +0,0 @@ https://github.com/ruby/ruby/blob/trunk/test/test_curses.rb#L0 -require 'test/unit' -require_relative 'ruby/envutil' - -begin - require 'curses' - require 'pty' -rescue LoadError -end - -class TestCurses < Test::Unit::TestCase - def test_version - assert_instance_of(String, Curses::VERSION) - end -end if defined? Curses - -class TestCurses - def run_curses(src, input = nil, timeout: 1) - r, w, pid = PTY.spawn({"TERM"=>ENV["TERM"]||"dumb"}, EnvUtil.rubybin, "-e", <<-"src") -require 'timeout' -require 'curses' -include Curses -init_screen -begin - result = Timeout.timeout(#{timeout}) do - print "!" - #{src} - end -rescue Exception => e -ensure - close_screen - puts "", [Marshal.dump([result, e])].pack('m').delete("\n") - print "\\0" - $stdio.flush -end -src - begin - wait = r.readpartial(1) - if wait != "!" - wait << r.readpartial(1000) - raise "TERM: '#{ENV["TERM"]}'; #{wait}" - end - if input - w.print(input) - w.flush - end - res = r.gets("\0") - return unless res - res.chomp!("\0") - res, error = Marshal.load(res[/(.*)\Z/, 1].unpack('m')[0]) - raise error if error - return res - ensure - r.close unless r.closed? - w.close unless w.closed? - Process.wait(pid) - end - end - - def test_getch - assert_equal("a", run_curses("getch", "a")) - end - def test_getch_cbreak - assert_equal("a", run_curses("cbreak; getch", "a")) - end - def test_getch_nocbreak - assert_raise(Timeout::Error) {run_curses("nocbreak; getch", "a")} - end - def test_getch_crmode - assert_equal("a", run_curses("crmode; getch", "a")) - end - def test_getch_nocrmode - assert_raise(Timeout::Error) {run_curses("nocrmode; getch", "a")} - end -end if defined? TestCurses and defined? PTY -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/