From eb23fa3b14841b48b2b6c6652364f7e6a26f342b Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Fri, 20 Aug 2004 18:01:36 +0000 Subject: [PATCH] Fixed some space problems in Google.calc. --- plugins/Google.py | 4 ++-- test/test_Google.py | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/Google.py b/plugins/Google.py index 8a9545be4..48febe478 100644 --- a/plugins/Google.py +++ b/plugins/Google.py @@ -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.') diff --git a/test/test_Google.py b/test/test_Google.py index ee722e682..7f58a7c91 100644 --- a/test/test_Google.py +++ b/test/test_Google.py @@ -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'))