From bcbeb5d008c1e91454b7f2c2d0e1d7b4735006e2 Mon Sep 17 00:00:00 2001 From: marcandre Date: Thu, 24 Jan 2013 06:23:07 +0000 Subject: * enumerator.c: Fix state handling for Lazy#drop_while [bug #7696] [bug #7691] * test/ruby/test_lazy_enumerator.rb: test for above git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38921 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_lazy_enumerator.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/ruby/test_lazy_enumerator.rb') diff --git a/test/ruby/test_lazy_enumerator.rb b/test/ruby/test_lazy_enumerator.rb index 35e92c9050..a7c5a4a947 100644 --- a/test/ruby/test_lazy_enumerator.rb +++ b/test/ruby/test_lazy_enumerator.rb @@ -250,6 +250,13 @@ class TestLazyEnumerator < Test::Unit::TestCase assert_equal([*(1..5)]*5, take5.flat_map{take5}.force, bug7696) end + def test_drop_while_nested + bug7696 = '[ruby-core:51470]' + a = Step.new(1..10) + drop5 = a.lazy.drop_while{|x| x < 6} + 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