diff options
| author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-05-03 11:57:55 +0000 |
|---|---|---|
| committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-05-03 11:57:55 +0000 |
| commit | b22e7a6c74d209323c5daa0f3ab1303a92056178 (patch) | |
| tree | d72d20d335ef4800d47ec008603685cc7f202692 /test/ruby/test_continuation.rb | |
| parent | 20b719c5d7faaf87b2c01eb3cefb3e201ca1e58a (diff) | |
| download | ruby-b22e7a6c74d209323c5daa0f3ab1303a92056178.tar.gz ruby-b22e7a6c74d209323c5daa0f3ab1303a92056178.tar.xz ruby-b22e7a6c74d209323c5daa0f3ab1303a92056178.zip | |
* test/ruby/envutil.rb (Test::Unit::Assertions#assert_normal_exit):
new method.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16279 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_continuation.rb')
| -rw-r--r-- | test/ruby/test_continuation.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/ruby/test_continuation.rb b/test/ruby/test_continuation.rb index 0313d7124..272599650 100644 --- a/test/ruby/test_continuation.rb +++ b/test/ruby/test_continuation.rb @@ -1,6 +1,7 @@ require 'test/unit' require 'continuation' require 'fiber' +require_relative 'envutil' class TestContinuation < Test::Unit::TestCase def test_create @@ -50,5 +51,19 @@ class TestContinuation < Test::Unit::TestCase c.call } end + + def test_sort + assert_normal_exit(<<-'End') + require 'continuation' + n = 1000 + ary = (1..100).to_a + ary.sort! {|a,b| + callcc {|k| $k = k } if !defined? $k + a <=> b + } + n -= 1 + $k.call if 0 < n + End + end end |
