summaryrefslogtreecommitdiff
path: root/proc.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-07-17 18:08:40 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-07-17 18:08:40 +0000
commit85dc1ab23b18ef7cb989eb4f4c704e8f8d30e12e (patch)
tree33f1a9053a819ad89c5bfe06ed0ccacce64fd78a /proc.c
parent3d68a73687b1b64651fc814087ae928b42d48bf0 (diff)
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.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/proc.c b/proc.c
index 9502f98772..5612f95fac 100644
--- a/proc.c
+++ b/proc.c
@@ -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