Skip to content

Commit

Permalink
Refactor the tests for readability.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbyrnepr2 committed May 22, 2024
1 parent cbd20f1 commit aab51bb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
11 changes: 8 additions & 3 deletions tests/functional/d/duplicate/duplicate_argument_name.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Check for duplicate function arguments."""

# pylint: disable=missing-docstring, line-too-long
# pylint: disable=missing-docstring, line-too-long, unused-argument


def foo1(_, _): # [duplicate-argument-name]
Expand All @@ -18,6 +18,11 @@ def foo4(_, *, _): # [duplicate-argument-name]
def foo5(_, *_, _=3): # [duplicate-argument-name, duplicate-argument-name]
...

# +1: [duplicate-argument-name, duplicate-argument-name, duplicate-argument-name, duplicate-argument-name]
def foo6(_, /, _, *_, _="_", **_):
def foo6(a, *a): # [duplicate-argument-name]
...

def foo7(a, /, a): # [duplicate-argument-name]
...

def foo8(a, **a): # [duplicate-argument-name]
...
7 changes: 3 additions & 4 deletions tests/functional/d/duplicate/duplicate_argument_name.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ duplicate-argument-name:12:12:12:13:foo3:Duplicate argument name '_' in function
duplicate-argument-name:15:15:15:16:foo4:Duplicate argument name '_' in function definition:HIGH
duplicate-argument-name:18:13:18:14:foo5:Duplicate argument name '_' in function definition:HIGH
duplicate-argument-name:18:16:18:17:foo5:Duplicate argument name '_' in function definition:HIGH
duplicate-argument-name:22:15:22:16:foo6:Duplicate argument name '_' in function definition:HIGH
duplicate-argument-name:22:19:22:20:foo6:Duplicate argument name '_' in function definition:HIGH
duplicate-argument-name:22:22:22:23:foo6:Duplicate argument name '_' in function definition:HIGH
duplicate-argument-name:22:31:22:32:foo6:Duplicate argument name '_' in function definition:HIGH
duplicate-argument-name:21:13:21:14:foo6:Duplicate argument name 'a' in function definition:HIGH
duplicate-argument-name:24:15:24:16:foo7:Duplicate argument name 'a' in function definition:HIGH
duplicate-argument-name:27:14:27:15:foo8:Duplicate argument name 'a' in function definition:HIGH

0 comments on commit aab51bb

Please sign in to comment.