diff --git a/Makefile b/Makefile index 1876c51..e7a68ec 100644 --- a/Makefile +++ b/Makefile @@ -35,22 +35,18 @@ INSPIRCD_SELECTORS := \ and not strict \ $(EXTRA_SELECTORS) -# HelpTestCase fails because it returns NOTICEs instead of numerics IRCU2_SELECTORS := \ not Ergo \ and not deprecated \ and not strict \ $(EXTRA_SELECTORS) -# same justification as ircu2 -# lusers "unregistered" tests fail because NEFARIOUS_SELECTORS := \ not Ergo \ and not deprecated \ and not strict \ $(EXTRA_SELECTORS) -# same justification as ircu2 SNIRCD_SELECTORS := \ not Ergo \ and not deprecated \ diff --git a/irctest/cases.py b/irctest/cases.py index eea0f8c..30b1aed 100644 --- a/irctest/cases.py +++ b/irctest/cases.py @@ -802,7 +802,7 @@ def xfailIf( def decorator(f: Callable[..., _TReturn]) -> Callable[..., _TReturn]: @functools.wraps(f) def newf(self: _TSelf, *args: Any, **kwargs: Any) -> _TReturn: - if condition(self): + if condition(self, *args, **kwargs): try: return f(self, *args, **kwargs) except Exception: @@ -819,7 +819,10 @@ def xfailIf( def xfailIfSoftware( names: List[str], reason: str ) -> Callable[[Callable[..., _TReturn]], Callable[..., _TReturn]]: - return xfailIf(lambda testcase: testcase.controller.software_name in names, reason) + def pred(testcase: _IrcTestCase, *args: Any, **kwargs: Any) -> bool: + return testcase.controller.software_name in names + + return xfailIf(pred, reason) def mark_services(cls: TClass) -> TClass: diff --git a/irctest/server_tests/who.py b/irctest/server_tests/who.py index 15bdeb3..0e4b280 100644 --- a/irctest/server_tests/who.py +++ b/irctest/server_tests/who.py @@ -496,6 +496,46 @@ class WhoTestCase(BaseWhoTestCase, cases.BaseServerTestCase): params=["otherNick", InsensitiveStr("coolNick"), ANYSTR], ) + @pytest.mark.parametrize("char", "cuihsnfdlaor") + @cases.xfailIf( + lambda self, char: bool( + char == "l" and self.controller.software_name == "ircu2" + ), + "https://github.com/UndernetIRC/ircu2/commit/17c539103abbd0055b2297e17854cd0756c85d62", + ) + @cases.xfailIf( + lambda self, char: bool( + char == "l" and self.controller.software_name == "Nefarious" + ), + "https://github.com/evilnet/nefarious2/pull/73", + ) + def testWhoxOneChar(self, char): + self._init() + if "WHOX" not in self.server_support: + raise runner.IsupportTokenNotSupported("WHOX") + + self.sendLine(2, f"WHO coolNick %{char}") + messages = self.getMessages(2) + + self.assertEqual(len(messages), 2, "Unexpected number of messages") + + (reply, end) = messages + + self.assertMessageMatch( + reply, + command=RPL_WHOSPCRPL, + params=[ + "otherNick", + StrRe(".+"), + ], + ) + + self.assertMessageMatch( + end, + command=RPL_ENDOFWHO, + params=["otherNick", InsensitiveStr("coolNick"), ANYSTR], + ) + def testWhoxToken(self): """https://github.com/ircv3/ircv3-specifications/pull/482""" self._init()