diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-07-17 18:08:40 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-07-17 18:08:40 +0000 |
commit | 85dc1ab23b18ef7cb989eb4f4c704e8f8d30e12e (patch) | |
tree | 33f1a9053a819ad89c5bfe06ed0ccacce64fd78a /proc.c | |
parent | 3d68a73687b1b64651fc814087ae928b42d48bf0 (diff) | |
download | ruby-85dc1ab23b18ef7cb989eb4f4c704e8f8d30e12e.tar.gz |
Add tests for r36415.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36420 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'proc.c')
-rw-r--r-- | proc.c | 31 |
1 files changed, 19 insertions, 12 deletions
@@ -622,18 +622,25 @@ rb_proc_call_with_block(VALUE self, int argc, VALUE *argv, VALUE pass_procval) * arguments. A <code>proc</code> with no argument declarations * is the same a block declaring <code>||</code> as its arguments. * - * Proc.new {}.arity #=> 0 - * Proc.new {||}.arity #=> 0 - * Proc.new {|a|}.arity #=> 1 - * Proc.new {|a,b|}.arity #=> 2 - * Proc.new {|a,b,c|}.arity #=> 3 - * Proc.new {|*a|}.arity #=> -1 - * Proc.new {|a,*b|}.arity #=> -2 - * Proc.new {|a,*b, c|}.arity #=> -3 - * lambda { |a = 0| }.arity #=> -1 - * lambda { |a, b = 0| }.arity #=> -2 - * lambda { |a, b = 0, c = 0| }.arity #=> -2 - * lambda { |(a, b), c = 0| }.arity #=> -2 + * proc {}.arity #=> 0 + * proc {||}.arity #=> 0 + * proc {|a|}.arity #=> 1 + * proc {|a,b|}.arity #=> 2 + * proc {|a,b,c|}.arity #=> 3 + * proc {|*a|}.arity #=> -1 + * proc {|a,*b|}.arity #=> -2 + * proc {|a,*b, c|}.arity #=> -3 + * + * proc { |x = 0| }.arity #=> 0 + * lambda { |a = 0| }.arity #=> -1 + * proc { |x=0, y| }.arity #=> 0 + * lambda { |x=0, y| }.arity #=> -2 + * proc { |x=0, y=0| }.arity #=> 0 + * lambda { |x=0, y=0| }.arity #=> -1 + * proc { |x, y=0| }.arity #=> 1 + * lambda { |x, y=0| }.arity #=> -2 + * proc { |(x, y), z=0| }.arity #=> 1 + * lambda { |(x, y), z=0| }.arity #=> -2 */ static VALUE |