Fixed bug in strlen where it didn't account for spaces.

This commit is contained in:
Jeremy Fincher 2003-08-30 22:54:11 +00:00
parent ea34e11d0d
commit c891592b59
2 changed files with 2 additions and 0 deletions

View File

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

View File

@ -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"')