diff options
author | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-03-16 02:22:20 +0000 |
---|---|---|
committer | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-03-16 02:22:20 +0000 |
commit | 29f73009ca934cfa7b51d1de4d22933ab56dc602 (patch) | |
tree | 4aa491f74ddf6aa4ff8827e7c076c9a3fa8d0ed9 /test/ruby/test_lazy_enumerator.rb | |
parent | a1f4163dd330d2cddbde0fa3407713e2338a2e7b (diff) |
* enumerator.c (lazy_take): don't enumerate an extra value.
[ruby-dev:45370] [Bug #6152]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35050 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_lazy_enumerator.rb')
-rw-r--r-- | test/ruby/test_lazy_enumerator.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/test/ruby/test_lazy_enumerator.rb b/test/ruby/test_lazy_enumerator.rb index b096821191..0f2fa2bc41 100644 --- a/test/ruby/test_lazy_enumerator.rb +++ b/test/ruby/test_lazy_enumerator.rb @@ -201,7 +201,11 @@ class TestLazyEnumerator < Test::Unit::TestCase assert_equal(5, a.current) assert_equal(1, a.lazy.take(5).first) assert_equal(1, a.current) - assert_equal((1..5).to_a, a.lazy.take(5).to_a) + assert_equal((1..5).to_a, a.lazy.take(5).force) + assert_equal(5, a.current) + a = Step.new(1..10) + assert_equal([], a.lazy.take(0).force) + assert_equal(nil, a.current) end def test_take_while |