aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_iterator.rb
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-08-24 10:48:43 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-08-24 10:48:43 +0000
commit901343a761e7868839e00c69ac142353db734d0e (patch)
tree1d17d2ca125db42acd397b48acdf4be763caf434 /test/ruby/test_iterator.rb
parent4e183b11acebdbce9fe843059ddb8e18e491cce1 (diff)
downloadruby-901343a761e7868839e00c69ac142353db734d0e.tar.gz
* enumerator.c (enumerator_next): stop pre-fetching.
* enumerator.c (Init_Enumerator): remove next? method. * eval.c (rb_f_loop): now handles StopIteration exception. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_iterator.rb')
-rw-r--r--test/ruby/test_iterator.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/ruby/test_iterator.rb b/test/ruby/test_iterator.rb
index 45f1452629..9d99731a3c 100644
--- a/test/ruby/test_iterator.rb
+++ b/test/ruby/test_iterator.rb
@@ -496,13 +496,15 @@ class TestIterator < Test::Unit::TestCase
e = [1,2,3].each
assert_equal(1, e.next)
- assert_equal(true, e.next?)
assert_equal(2, e.next)
assert_equal(3, e.next)
assert_raises(StopIteration){e.next}
e.rewind
- assert_equal(true, e.next?)
assert_equal(1, e.next)
+ e.rewind
+ a = []
+ loop{a.push e.next}
+ assert_equal([1,2,3], a)
assert_equal([[1, 8, 10], [2, 6, 11], [3, 4, 12]],
(1..10).zip([8,6,4],(10..100)).to_a)