diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-05-25 02:54:22 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-05-25 02:54:22 +0000 |
| commit | 6ce9e4174f6b0bb9f2c6e753bea2b1bab1ceb18e (patch) | |
| tree | 984e25ff964970fdb73b0a6fee124336d12e0224 /test | |
| parent | 1a6efc5bf04701e1e3f33a6cc9d0c1197175acee (diff) | |
| download | ruby-6ce9e4174f6b0bb9f2c6e753bea2b1bab1ceb18e.tar.gz ruby-6ce9e4174f6b0bb9f2c6e753bea2b1bab1ceb18e.tar.xz ruby-6ce9e4174f6b0bb9f2c6e753bea2b1bab1ceb18e.zip | |
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@6402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
| -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 8d8b17e0d..7a5f6a155 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 |
