summaryrefslogtreecommitdiff
path: root/bootstraptest/test_block.rb
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-07-07 07:16:05 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-07-07 07:16:05 +0000
commit0ec2b20d2f1339ab1e4d41567f9b37d733802968 (patch)
treea3b0c71a5af92bc32654742681fcc5edc8371a94 /bootstraptest/test_block.rb
parent174b77b2805bca12afb67d24bfc4ce9182a8daac (diff)
* parse.y: fix node construction (around f_margs).
[ruby-dev:31143] * bootstraptest/test_block.rb: add a test for above. * insnhelper.ci: fix indent. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12720 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bootstraptest/test_block.rb')
-rw-r--r--bootstraptest/test_block.rb31
1 files changed, 31 insertions, 0 deletions
diff --git a/bootstraptest/test_block.rb b/bootstraptest/test_block.rb
index 21d1343..cdfd3e4 100644
--- a/bootstraptest/test_block.rb
+++ b/bootstraptest/test_block.rb
@@ -336,6 +336,36 @@ assert_equal %q{[1, nil]}, %q{
}
}
+# block parameter (shouldn't SEGV: [ruby-dev:31143])
+assert_equal '0', %q{
+def m()
+end
+m {|(v0,*,(*)),|}
+m {|(*v0,(*)),|}
+m {|(v0,*v1,(*)),|}
+m {|((v0,*v1,v2)),|}
+m {|(v0,*v1,v2),|}
+m {|(v0,*v1,(v2)),|}
+m {|((*),*v0,v1),|}
+m {|((v0),*v1,v2),|}
+m {|(v0,v1,*v2,v3),|}
+m {|v0,(v1,*v2,v3),|}
+m {|(v0,*v1,v2),v3,|}
+m {|(v0,*v1,v2)|}
+m {|(v0,*v1,v2),&v3|}
+m {|(v0,*v1,v2),*|}
+m {|(v0,*v1,v2),*,&v3|}
+m {|*,(v0,*v1,v2)|}
+m {|*,(v0,*v1,v2),&v3|}
+m {|v0,*,(v1,*v2,v3)|}
+m {|v0,*,(v1,*v2,v3),&v4|}
+m {|(v0,*v1,v2),*,v3|}
+m {|(v0,*v1,v2),*,v3,&v4|}
+m {|(v0, *v1, v2)|}
+m {|(*,v)|}
+0
+}
+
# [ruby-dev:31147]
assert_equal 'nil', %q{
def m
@@ -343,3 +373,4 @@ assert_equal 'nil', %q{
end
m{|&b| b}.inspect
}
+