SedRegex: test "nick, " prefix for explicit reference as well as "nick: "

This commit is contained in:
James Lu 2020-10-18 13:42:12 -07:00
parent 6c138d66ba
commit 5ee63ebe96

View File

@ -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):