summaryrefslogtreecommitdiffhomepage
path: root/test/t
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2016-11-25 09:26:01 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2016-11-25 09:26:01 +0900
commit9f7701e27a136b033cdc1b3fd05ee9898e1ea802 (patch)
tree302461ab1ffd553429d0e952815030d065ac9e59 /test/t
parent0d48a9786f9202f4890df53682117429b9350516 (diff)
parentcc2786c84e048123e4bce40cf4ea06ac172de5a4 (diff)
downloadmruby-9f7701e27a136b033cdc1b3fd05ee9898e1ea802.tar.gz
mruby-9f7701e27a136b033cdc1b3fd05ee9898e1ea802.zip
Merge branch 'bouk-retry-codegen-misalign'
Diffstat (limited to 'test/t')
-rw-r--r--test/t/codegen.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/t/codegen.rb b/test/t/codegen.rb
index cb2e75f93..7177053ae 100644
--- a/test/t/codegen.rb
+++ b/test/t/codegen.rb
@@ -13,3 +13,21 @@ end
assert('empty condition in ternary expression parses correctly') do
assert_equal(() ? 1 : 2, 2)
end
+
+assert('codegen absorbs arguments to redo and retry if they are the argument of a call') do
+ assert_nothing_raised do
+ a=*"1", case nil
+ when 1
+ redo |
+ 1
+ end
+ end
+
+ assert_nothing_raised do
+ a=*"1", case nil
+ when 1
+ retry |
+ 1
+ end
+ end
+end