diff options
author | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-01-24 06:23:42 +0000 |
---|---|---|
committer | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-01-24 06:23:42 +0000 |
commit | 9d94a1a5a18f80974e017cb81790a08dad84faef (patch) | |
tree | 1ac1bf77739d757895acd4a33c708ac92589ee91 /test/ruby | |
parent | bcbeb5d008c1e91454b7f2c2d0e1d7b4735006e2 (diff) | |
download | ruby-9d94a1a5a18f80974e017cb81790a08dad84faef.tar.gz |
* 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
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_lazy_enumerator.rb | 7 |
1 files changed, 7 insertions, 0 deletions
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) |