Skip to content

Commit

Permalink
Shorten ListRemainder's repr() when possible.
Browse files Browse the repository at this point in the history
  • Loading branch information
progval committed Mar 5, 2022
1 parent 2a4e71e commit 8356ace
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions irctest/patma.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ class ListRemainder:
def __repr__(self) -> str:
if self.min_length:
return f"ListRemainder({self.item!r}, min_length={self.min_length})"
elif self.item is ANYSTR:
return "*ANYLIST"
else:
return f"ListRemainder({self.item!r})"

Expand Down
4 changes: 2 additions & 2 deletions irctest/self_tests/cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,8 @@
],
# and they each error with:
[
"expected params to match ['nick', 'FOO=1', ListRemainder(ANYSTR)], got ['nick']",
"expected params to match ['nick', 'FOO=1', ListRemainder(ANYSTR)], got ['nick', 'BAR=2']",
"expected params to match ['nick', 'FOO=1', *ANYLIST], got ['nick']",
"expected params to match ['nick', 'FOO=1', *ANYLIST], got ['nick', 'BAR=2']",
]
),
(
Expand Down

0 comments on commit 8356ace

Please sign in to comment.