aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_lazy_enumerator.rb
diff options
context:
space:
mode:
authormarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-01-24 06:23:07 +0000
committermarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-01-24 06:23:07 +0000
commitbcbeb5d008c1e91454b7f2c2d0e1d7b4735006e2 (patch)
tree986e4943ead7213784247920eacd19c1cf1fb3f4 /test/ruby/test_lazy_enumerator.rb
parentde0e88763561e4a5ee6be87dd6eee524ccf9c391 (diff)
downloadruby-bcbeb5d008c1e91454b7f2c2d0e1d7b4735006e2.tar.gz
* 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
Diffstat (limited to 'test/ruby/test_lazy_enumerator.rb')
-rw-r--r--test/ruby/test_lazy_enumerator.rb7
1 files changed, 7 insertions, 0 deletions
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)