Skip to content

Commit

Permalink
add tests for duplicate variable name check with p_rest (#966)
Browse files Browse the repository at this point in the history
  • Loading branch information
iliabylich authored Dec 28, 2023
1 parent 00eb452 commit e368bb9
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/test_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9797,6 +9797,18 @@ def test_pattern_matching_duplicate_variable_name
%q{0 => [a, a]},
%q{ ^ location},
SINCE_3_0)

assert_diagnoses(
[:error, :duplicate_variable_name, { :name => 'a' }],
%q{0 in [a, *a]},
%q{ ^ location},
SINCE_3_3)

assert_diagnoses(
[:error, :duplicate_variable_name, { :name => 'a' }],
%q{0 in [*a, a, b, *b]},
%q{ ^ location},
SINCE_3_3)
end

def test_pattern_matching_duplicate_hash_keys
Expand Down

0 comments on commit e368bb9

Please sign in to comment.