Fixed some space problems in Google.calc.

This commit is contained in:
Jeremy Fincher 2004-08-20 18:01:36 +00:00
parent 71c752a7fb
commit eb23fa3b14
2 changed files with 5 additions and 3 deletions

View File

@ -422,8 +422,8 @@ class Google(callbacks.PrivmsgCommandAndRegexp):
if match is not None:
s = match.group(1)
s = self._calcSupRe.sub(r'^(\1)', s)
s = self._calcFontRe.sub(r' , ', s)
s = self._calcTimesRe.sub(r' * ', s)
s = self._calcFontRe.sub(r',', s)
s = self._calcTimesRe.sub(r'*', s)
irc.reply(s)
else:
irc.reply('Google\'s calculator didn\'t come up with anything.')

View File

@ -42,8 +42,10 @@ class GoogleTestCase(ChannelPluginTestCase, PluginDocumentation):
self.assertNotRegexp('google calc '
'the speed of light '
'in microns / fortnight', '×')
def testCalcDoesNotHaveExtraSpaces(self):
self.assertNotRegexp('google calc 1000^2', r'\s+,\s+')
def testNoNoLicenseKeyError(self):
conf.supybot.plugins.Google.groupsSnarfer.setValue(True)
self.irc.feedMsg(ircmsgs.privmsg(self.channel, 'google blah'))