diff options
author | Kazuki Tsujimoto <[email protected]> | 2023-03-26 15:33:43 +0900 |
---|---|---|
committer | Kazuki Tsujimoto <[email protected]> | 2023-03-26 18:56:21 +0900 |
commit | 6c0925ba7017efde6091e2ec4f1a6be268166696 (patch) | |
tree | 86ff05358931208c74bdf994bfa004bbf3bd2bdd /test/ruby/test_pattern_matching.rb | |
parent | 2f916812a9b818b432ee7c299e021ec62d4727fb (diff) |
[Bug #19175] p_rest should be `assignable'
It should also check for duplicate names.
Diffstat (limited to 'test/ruby/test_pattern_matching.rb')
-rw-r--r-- | test/ruby/test_pattern_matching.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_pattern_matching.rb b/test/ruby/test_pattern_matching.rb index 0337e5d945..a5083ffabd 100644 --- a/test/ruby/test_pattern_matching.rb +++ b/test/ruby/test_pattern_matching.rb @@ -800,6 +800,10 @@ END true end end + + assert_syntax_error(%q{ + 0 => [a, *a] + }, /duplicated variable name/) end def test_find_pattern @@ -868,6 +872,10 @@ END false end end + + assert_syntax_error(%q{ + 0 => [*a, a, b, *b] + }, /duplicated variable name/) end def test_hash_pattern |