diff options
Diffstat (limited to 'test/ruby/test_pattern_matching.rb')
-rw-r--r-- | test/ruby/test_pattern_matching.rb | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/ruby/test_pattern_matching.rb b/test/ruby/test_pattern_matching.rb index 6aa7c82361..8e8a7102aa 100644 --- a/test/ruby/test_pattern_matching.rb +++ b/test/ruby/test_pattern_matching.rb @@ -547,6 +547,20 @@ END end assert_block do + case [0] + in [0,] + true + end + end + + assert_block do + case [0, 1] + in [0,] + true + end + end + + assert_block do case [] in [0, *a] else @@ -626,6 +640,21 @@ END a == [1] end end + + assert_block do + case [0] + in [0, *, 1] + else + true + end + end + + assert_block do + case [0, 1] + in [0, *, 1] + true + end + end end def test_hash_pattern |