diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-05 13:46:11 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-05 13:46:11 +0000 |
commit | 31e6f72c8ea0990ca7acdfc7b99b89abd4566f0b (patch) | |
tree | 65e21bfa74be32ea9811a108516308316b5dbc65 /test/ruby/test_lazy_enumerator.rb | |
parent | 1bddcc72f6e6f7cd5708d9ae34aa3b4a6bbde6c1 (diff) |
vm.c: save blockprocval
* vm.c (rb_vm_make_proc): save the proc made from the given block so
that it will not get collected. [ruby-core:50545] [Bug #7507]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38213 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_lazy_enumerator.rb')
-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 5443bd0a3b..232e0fed3a 100644 --- a/test/ruby/test_lazy_enumerator.rb +++ b/test/ruby/test_lazy_enumerator.rb @@ -1,4 +1,5 @@ require 'test/unit' +require_relative 'envutil' class TestLazyEnumerator < Test::Unit::TestCase class Step @@ -356,4 +357,10 @@ EOS assert_equal nil, lazy.select{}.cycle(4).size assert_equal nil, lazy.select{}.cycle.size end + + def test_map_zip + bug7507 = '[ruby-core:50545]' + assert_ruby_status(["-e", "GC.stress = true", "-e", "(1..10).lazy.map{}.zip(){}"], bug7507) + assert_ruby_status(["-e", "GC.stress = true", "-e", "(1..10).lazy.map{}.zip().to_a"], bug7507) + end end |