diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-07-27 08:09:03 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-07-27 08:09:03 +0000 |
commit | 044aa29b7dbf395d90b27b97831e78df07a7f8aa (patch) | |
tree | 8ffd21f674351ba8b5a674ee537fb6dc8cbc1d0d /test | |
parent | 76ff1d90c809fe61616fac7ff26b3c98bdd49f3a (diff) | |
download | ruby-044aa29b7dbf395d90b27b97831e78df07a7f8aa.tar.gz |
test_lazy_enumerator.rb: test for cycle chain
* test/ruby/test_lazy_enumerator.rb (test_cycle_chain): more test for
infinite sequence.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36549 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_lazy_enumerator.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/test/ruby/test_lazy_enumerator.rb b/test/ruby/test_lazy_enumerator.rb index 8ed6da2800..106f8006f9 100644 --- a/test/ruby/test_lazy_enumerator.rb +++ b/test/ruby/test_lazy_enumerator.rb @@ -286,7 +286,8 @@ class TestLazyEnumerator < Test::Unit::TestCase end def test_cycle_chain - a = Step.new(1..3) + a = 1..3 + assert_equal([1,2,3,1,2,3,1,2,3,1], a.lazy.cycle.take(10).force) assert_equal([2,2,2,2,2,2,2,2,2,2], a.lazy.cycle.select {|x| x == 2}.take(10).force) assert_equal([2,2,2,2,2,2,2,2,2,2], a.lazy.select {|x| x == 2}.cycle.take(10).force) end |