ruby-changes:11664
From: kazu <ko1@a...>
Date: Tue, 28 Apr 2009 19:11:30 +0900 (JST)
Subject: [ruby-changes:11664] Ruby:r23303 (ruby_1_8): test/test_timeout.rb: backported from 1.9.
kazu 2009-04-28 19:11:19 +0900 (Tue, 28 Apr 2009) New Revision: 23303 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=23303 Log: test/test_timeout.rb: backported from 1.9. Added files: branches/ruby_1_8/test/test_timeout.rb Modified files: branches/ruby_1_8/ChangeLog Index: ruby_1_8/ChangeLog =================================================================== --- ruby_1_8/ChangeLog (revision 23302) +++ ruby_1_8/ChangeLog (revision 23303) @@ -1,3 +1,7 @@ +Tue Apr 28 19:10:42 2009 Kazuhiro NISHIYAMA <zn@m...> + + * test/test_timeout.rb: backported from 1.9. + Fri Apr 24 14:55:15 2009 Nobuyoshi Nakada <nobu@r...> * eval.c (rb_thread_start_timer): guard condition was inverted. Index: ruby_1_8/test/test_timeout.rb =================================================================== --- ruby_1_8/test/test_timeout.rb (revision 0) +++ ruby_1_8/test/test_timeout.rb (revision 23303) @@ -0,0 +1,26 @@ +require 'test/unit' +require 'timeout' +require 'thread' + +class TestTimeout < Test::Unit::TestCase + def test_queue + q = Queue.new + assert_raise(Timeout::Error, "[ruby-dev:32935]") { + timeout(0.1) { q.pop } + } + end + + def test_timeout + @flag = true + Thread.start { + sleep 0.1 + @flag = false + } + assert_nothing_raised("[ruby-dev:38319]") do + Timeout.timeout(1) { + nil while @flag + } + end + assert !@flag, "[ruby-dev:38319]" + end +end Property changes on: ruby_1_8/test/test_timeout.rb ___________________________________________________________________ Name: svn:mergeinfo + Name: svn:eol-style + LF Name: svn:keywords + Author Date Id Revision -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/