mirror of
https://github.com/ruby/ruby.git
synced 2025-08-26 06:25:31 +02:00
* cont.c: separate Continuation and Fiber from core.
* ext/continuation/*, ext/fiber/*: ditto. * include/ruby/ruby.h: remove rb_cFiber. * include/ruby/intern.h: add the rb_fiber_new() declaration. * enumerator.c (next_init): fix to use rb_fiber_new(). * test/ruby/test_enumerator.rb: remove next? tests. * test/ruby/test_continuation.rb: add a require 'continuation'. * test/ruby/test_fiber.rb: add a require 'fiber'. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
cfaf3d9a1a
commit
977d66ec99
12 changed files with 83 additions and 40 deletions
|
@ -24,14 +24,13 @@ class TestEnumerator < Test::Unit::TestCase
|
|||
assert_raise(StopIteration){e.next}
|
||||
end
|
||||
|
||||
def test_next?
|
||||
def test_loop
|
||||
e = 3.times
|
||||
assert_equal true, e.next?
|
||||
3.times{|i|
|
||||
assert_equal true, e.next?
|
||||
assert_equal i, e.next
|
||||
i = 0
|
||||
loop{
|
||||
assert_equal(i, e.next)
|
||||
i += 1
|
||||
}
|
||||
assert_equal false, e.next?
|
||||
end
|
||||
|
||||
def test_nested_itaration
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue