From 044aa29b7dbf395d90b27b97831e78df07a7f8aa Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 27 Jul 2012 08:09:03 +0000 Subject: [PATCH] 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 --- test/ruby/test_lazy_enumerator.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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