From 091333f9eaddeb3302ee4ae5a4cfc14a62695653 Mon Sep 17 00:00:00 2001 From: akr Date: Sat, 3 May 2008 11:57:55 +0000 Subject: * test/ruby/envutil.rb (Test::Unit::Assertions#assert_normal_exit): new method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16279 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_continuation.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'test/ruby/test_continuation.rb') diff --git a/test/ruby/test_continuation.rb b/test/ruby/test_continuation.rb index 0313d71249..2725996504 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 -- cgit v1.2.3