mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-17 23:52:46 +01:00
Format.replace: replacement text is now allowed to be the empty string.
This commit is contained in:
parent
9398025088
commit
1b84e208ca
@ -97,7 +97,7 @@ class Format(callbacks.Plugin):
|
|||||||
with <substring to replace it with> in <text>.
|
with <substring to replace it with> in <text>.
|
||||||
"""
|
"""
|
||||||
irc.reply(text.replace(bad, good))
|
irc.reply(text.replace(bad, good))
|
||||||
replace = wrap(replace, ['something', 'something', 'text'])
|
replace = wrap(replace, ['something', 'anything', 'text'])
|
||||||
|
|
||||||
def upper(self, irc, msg, args, text):
|
def upper(self, irc, msg, args, text):
|
||||||
"""<text>
|
"""<text>
|
||||||
|
@ -58,6 +58,7 @@ class FormatTestCase(PluginTestCase):
|
|||||||
|
|
||||||
def testReplace(self):
|
def testReplace(self):
|
||||||
self.assertResponse('replace # %23 bla#foo', 'bla%23foo')
|
self.assertResponse('replace # %23 bla#foo', 'bla%23foo')
|
||||||
|
self.assertResponse('replace foo "" blafoobar', 'blabar')
|
||||||
|
|
||||||
def testUpper(self):
|
def testUpper(self):
|
||||||
self.assertResponse('upper foo', 'FOO')
|
self.assertResponse('upper foo', 'FOO')
|
||||||
|
Loading…
Reference in New Issue
Block a user