From 40d8543fbdec5485a638a2cb1008089d106b978d Mon Sep 17 00:00:00 2001 From: ko1 Date: Thu, 20 Dec 2007 08:20:02 +0000 Subject: * proc.c: support Proc#binding. * sample/test.rb: add a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- sample/test.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'sample') diff --git a/sample/test.rb b/sample/test.rb index 4cbddabfbf..a9940039cd 100644 --- a/sample/test.rb +++ b/sample/test.rb @@ -2178,6 +2178,15 @@ end test_ok(File.expand_path(".", "//") == "//") test_ok(File.expand_path("sub", "//") == "//sub") +# test_check "Proc#binding" +ObjectSpace.each_object(Proc){|o| + begin + b = o.binding + eval 'self', b + rescue ArgumentError + end +} + test_check "gc" begin 1.upto(10000) { @@ -2209,6 +2218,7 @@ test_ok true # reach here or dumps core ObjectSpace.each_object{|o| o.class.name } + test_ok true # reach here or dumps core if $failed > 0 -- cgit v1.2.3