From 977d66ec993b0f1892fb3e4cd8ac1c41716daf85 Mon Sep 17 00:00:00 2001 From: ko1 Date: Sat, 25 Aug 2007 02:03:44 +0000 Subject: * 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 --- test/ruby/test_enumerator.rb | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'test/ruby/test_enumerator.rb') diff --git a/test/ruby/test_enumerator.rb b/test/ruby/test_enumerator.rb index 885cb4a5fe..27a71e423d 100644 --- a/test/ruby/test_enumerator.rb +++ b/test/ruby/test_enumerator.rb @@ -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 -- cgit v1.2.3