From 9d94a1a5a18f80974e017cb81790a08dad84faef Mon Sep 17 00:00:00 2001 From: marcandre Date: Thu, 24 Jan 2013 06:23:42 +0000 Subject: * enumerator.c: Fix state handling for Lazy#drop [bug #7696] [bug #7691] * test/ruby/test_lazy_enumerator.rb: test for above git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_lazy_enumerator.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_lazy_enumerator.rb b/test/ruby/test_lazy_enumerator.rb index a7c5a4a947..2fdd854e8e 100644 --- a/test/ruby/test_lazy_enumerator.rb +++ b/test/ruby/test_lazy_enumerator.rb @@ -257,6 +257,13 @@ class TestLazyEnumerator < Test::Unit::TestCase assert_equal([*(6..10)]*5, drop5.flat_map{drop5}.force, bug7696) end + def test_drop_nested + bug7696 = '[ruby-core:51470]' + a = Step.new(1..10) + drop5 = a.lazy.drop(5) + assert_equal([*(6..10)]*5, drop5.flat_map{drop5}.force, bug7696) + end + def test_take_rewound bug7696 = '[ruby-core:51470]' e=(1..42).lazy.take(2) -- cgit v1.2.3