mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-30 22:24:20 +01:00
Fixed bug in strlen where it didn't account for spaces.
This commit is contained in:
parent
ea34e11d0d
commit
c891592b59
@ -130,6 +130,7 @@ class Utilities(callbacks.Privmsg):
|
||||
total = 0
|
||||
for arg in args:
|
||||
total += len(arg)
|
||||
total += len(args)-1 # spaces between the arguments.
|
||||
irc.reply(msg, str(total))
|
||||
|
||||
def repr(self, irc, msg, args):
|
||||
|
@ -55,6 +55,7 @@ class UtilitiesTestCase(PluginTestCase):
|
||||
|
||||
def testStrlen(self):
|
||||
self.assertResponse('strlen %s' % ('s'*10), '10')
|
||||
self.assertResponse('strlen a b', '3')
|
||||
|
||||
def testRepr(self):
|
||||
self.assertResponse('repr foo bar baz', '"foo bar baz"')
|
||||
|
Loading…
Reference in New Issue
Block a user