From 5ee63ebe96a1191a3ce9d758cf623e1ba0b623c3 Mon Sep 17 00:00:00 2001 From: James Lu Date: Sun, 18 Oct 2020 13:42:12 -0700 Subject: [PATCH] SedRegex: test "nick, " prefix for explicit reference as well as "nick: " --- plugins/SedRegex/test.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/SedRegex/test.py b/plugins/SedRegex/test.py index 06b574e5a..3df4ca2ee 100644 --- a/plugins/SedRegex/test.py +++ b/plugins/SedRegex/test.py @@ -109,10 +109,16 @@ class SedRegexTestCase(ChannelPluginTestCase): self.feedMsg('ouch', frm=self.__class__.other2) self.feedMsg('poof', frm=self.__class__.other) self.feedMsg('wow!') + + # This should work regardless of whether we use "nick," or "nick:" as prefix self.feedMsg('%s: s/^/p/' % ircutils.nickFromHostmask(self.__class__.other2)) m = self.getMsg(' ') self.assertIn('pouch', str(m)) + self.feedMsg('%s, s/^/c/' % ircutils.nickFromHostmask(self.__class__.other2)) + m = self.getMsg(' ') + self.assertIn('couch', str(m)) + @unittest.skipUnless(sys.version_info[0] >= 3, 'Test fails on Python 2.') def testBoldReplacement(self): with conf.supybot.plugins.sedregex.boldReplacementText.context(True):