mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 08:33:58 +02:00
* 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
This commit is contained in:
parent
1b79b5be82
commit
40d8543fbd
3 changed files with 51 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue