Fix for bug committed last night.

This commit is contained in:
Jeremy Fincher 2004-04-27 17:14:31 +00:00
parent b7fb78abed
commit b9524115b0
2 changed files with 7 additions and 1 deletions

View File

@ -60,7 +60,10 @@ class Misc(callbacks.Privmsg):
command = tokens and tokens[0] or ''
irc.error('%r is not a valid command.' % command)
else:
self.log.info('Not replying to %s, not a command.' % tokens[0])
if tokens:
# echo [] will get us an empty token set, but there's no need
# to log this in that case anyway, it being a nested command.
self.log.info('Not replying to %s, not a command.' % tokens[0])
if not isinstance(irc.irc, irclib.Irc):
irc.reply('[%s]' % ' '.join(tokens))

View File

@ -161,6 +161,9 @@ class MiscTestCase(ChannelPluginTestCase):
self.assertRegexp('more', 'more')
self.assertNotRegexp('more', 'more')
def testInvalidCommand(self):
self.assertResponse('echo []', '[]')
def testMoreIsCaseInsensitive(self):
self.assertNotError('echo %s' % ('abc'*2000))
self.assertNotError('more')