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

@ -43,6 +43,8 @@ class GoogleTestCase(ChannelPluginTestCase, PluginDocumentation):
'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)