From e7dac48a9190169a241865cd706566b52e07b3b7 Mon Sep 17 00:00:00 2001 From: ko1 Date: Thu, 19 Jun 2008 15:43:25 +0000 Subject: * proc.c (proc_new): fix to return Proc object if block is already in heap. [ruby-core:15711] * bootstraptest/test_proc.rb: add a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17442 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- bootstraptest/test_proc.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'bootstraptest/test_proc.rb') diff --git a/bootstraptest/test_proc.rb b/bootstraptest/test_proc.rb index f384ba3510..2fb5da41c9 100644 --- a/bootstraptest/test_proc.rb +++ b/bootstraptest/test_proc.rb @@ -378,3 +378,20 @@ assert_equal 'ok', %q{ m() } +assert_equal 'ok', %q{ + class Foo + def call_it + p = Proc.new + p.call + end + end + + def give_it + proc { :ok } + end + + f = Foo.new + a_proc = give_it + p :call_it + f.call_it(&give_it()) +}, '[ruby-core:15711]' -- cgit v1.2.3