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,6 +60,9 @@ class Misc(callbacks.Privmsg):
command = tokens and tokens[0] or '' command = tokens and tokens[0] or ''
irc.error('%r is not a valid command.' % command) irc.error('%r is not a valid command.' % command)
else: else:
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]) self.log.info('Not replying to %s, not a command.' % tokens[0])
if not isinstance(irc.irc, irclib.Irc): if not isinstance(irc.irc, irclib.Irc):
irc.reply('[%s]' % ' '.join(tokens)) irc.reply('[%s]' % ' '.join(tokens))

View File

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