diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2015-02-24 14:29:47 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2015-02-24 14:29:47 +0900 |
| commit | 68f60714dc54f0b040243428822213f5f1c0fc2b (patch) | |
| tree | fd3770e4e8dfb822043b428831d7bb2442972deb /test | |
| parent | d0bc006a739e5ee09ae00b09cda09902b1d71147 (diff) | |
| parent | 584d6de3c29cb2cfef79ff17ac12f17ace000391 (diff) | |
| download | mruby-68f60714dc54f0b040243428822213f5f1c0fc2b.tar.gz mruby-68f60714dc54f0b040243428822213f5f1c0fc2b.zip | |
Merge pull request #2729 from kou/fix-if-and-no-value-returned-case
Fix a bug that if and no return value case can't return true clause value
Diffstat (limited to 'test')
| -rw-r--r-- | test/t/syntax.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/t/syntax.rb b/test/t/syntax.rb index 7ec6272fe..2621e1b19 100644 --- a/test/t/syntax.rb +++ b/test/t/syntax.rb @@ -241,6 +241,20 @@ assert('Return values of case statements') do assert_equal 1, fb.call end +assert('Return values of if and case statements') do + true_clause_value = + if true + 1 + else + case 2 + when 3 + end + 4 + end + + assert_equal 1, true_clause_value +end + assert('splat in case statement') do values = [3,5,1,7,8] testa = [1,2,7] |
