mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
724d6ffd54
commit
091333f9ea
3 changed files with 46 additions and 0 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue