SedRegex: make callback matching case sensitive

This fixes a TypeError issue mentioned in d296bbb949.
This commit is contained in:
James Lu 2020-04-02 09:53:55 -07:00
parent 13c03716c5
commit c399272173
2 changed files with 5 additions and 0 deletions

View File

@ -66,6 +66,7 @@ class SedRegex(callbacks.PluginRegexp):
threaded = True
public = True
unaddressedRegexps = ['replacer']
flags = 0 # Make callback matching case sensitive
@staticmethod
def _unpack_sed(expr):

View File

@ -57,6 +57,10 @@ class SedRegexTestCase(ChannelPluginTestCase):
m = self.getMsg(' ')
self.assertIn('eliens', str(m))
def testIgnoreRegexpWithBadCase(self):
self.feedMsg('aliens are invading, help!')
self.assertNoResponse('S/aliens/monsters/')
def testGlobalReplace(self):
self.feedMsg('AAaa aaAa a b')
self.feedMsg('s/a/e/g')