diff options
| author | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-04-26 10:37:13 +0000 |
|---|---|---|
| committer | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-04-26 10:37:13 +0000 |
| commit | f2323f8869950537719d4df734bbcdc21a5915e1 (patch) | |
| tree | 947845f96cfa2da516060bbffb39a7f12c3df55c /test/ruby | |
| parent | 56d973d728cc74590b93a74450af14a6279e6d29 (diff) | |
* eval.c (rb_yield_0, proc_invoke, proc_arity): allow passing a block
to a Proc. [ruby-dev:23533]
* parse.y (block_par, block_var): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16205 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_proc.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_proc.rb b/test/ruby/test_proc.rb index f0b78ffb23..0ddc76a804 100644 --- a/test/ruby/test_proc.rb +++ b/test/ruby/test_proc.rb @@ -86,4 +86,9 @@ class TestProc < Test::Unit::TestCase b = lambda {} assert_not_equal(a, b) end + + def test_block_par + assert_equal(10, Proc.new{|&b| b.call(10)}.call {|x| x}) + assert_equal(12, Proc.new{|a,&b| b.call(a)}.call(12) {|x| x}) + end end |
