mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-26 04:32:51 +01:00
Format: allow empty substrings in 'replace'
This allows for easy substring removal without having to use regex.
This commit is contained in:
parent
c7fa33b8be
commit
0ed743bb8e
@ -109,7 +109,7 @@ class Format(callbacks.Plugin):
|
||||
with <substring to replace it with> in <text>.
|
||||
"""
|
||||
irc.reply(text.replace(bad, good))
|
||||
replace = wrap(replace, ['something', 'something', 'text'])
|
||||
replace = wrap(replace, ['anything', 'anything', 'text'])
|
||||
|
||||
def upper(self, irc, msg, args, text):
|
||||
"""<text>
|
||||
|
@ -59,6 +59,9 @@ class FormatTestCase(PluginTestCase):
|
||||
|
||||
def testReplace(self):
|
||||
self.assertResponse('replace # %23 bla#foo', 'bla%23foo')
|
||||
self.assertResponse('replace "/" "" t/e/s/t', 'test')
|
||||
self.assertResponse('replace "" :) hello', ':)h:)e:)l:)l:)o:)')
|
||||
self.assertResponse('replace de "d e" a b c de f ', 'a b c d e f')
|
||||
|
||||
def testUpper(self):
|
||||
self.assertResponse('upper foo', 'FOO')
|
||||
|
Loading…
Reference in New Issue
Block a user