From 67f08fb211d67bdb4b3362d7dab1c637325538fd Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Sat, 8 Apr 2023 18:22:45 +0200 Subject: [PATCH] what about two masks? --- irctest/server_tests/list.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/irctest/server_tests/list.py b/irctest/server_tests/list.py index ad61abb..631932c 100644 --- a/irctest/server_tests/list.py +++ b/irctest/server_tests/list.py @@ -271,6 +271,38 @@ class ListTestCase(_BasedListTestCase): self.sendLine(3, "LIST #chan1,#chan2") self.assertEqual(self._parseChanList(3), {"#chan1", "#chan2"}) + @cases.mark_isupport("ELIST") + def testListTwoMasks(self): + self.connectClient("foo") + + if "M" not in self.server_support.get("ELIST", ""): + raise runner.OptionalExtensionNotSupported("ELIST=M") + + if "TARGMAX" in self.server_support: + for item in (self.server_support["TARGMAX"]).split(","): + (command, max_) = item.split(":", 1) + if command == "LIST" and int(max_ or "1000") < 2: + raise runner.OptionalExtensionNotSupported("TARGMAX=LIST >= 2") + + self.sendLine(1, "JOIN #chan1") + self.getMessages(1) + self.sendLine(1, "JOIN #chan2") + self.getMessages(1) + self.sendLine(1, "JOIN #chan3") + self.getMessages(1) + + self.connectClient("bar") + self.sendLine(2, "JOIN #chan2") + self.getMessages(2) + + self.connectClient("baz") + + self.sendLine(3, "LIST") + self.assertEqual(self._parseChanList(3), {"#chan1", "#chan2", "#chan3"}) + + self.sendLine(3, "LIST *an1,*an2") + self.assertEqual(self._parseChanList(3), {"#chan1", "#chan2"}) + @cases.mark_isupport("ELIST") @cases.mark_specifications("Modern") def testListTwoParams(self):