Fixed a bug in handling of multiplication in results.

This commit is contained in:
Jeremy Fincher 2006-01-11 13:48:46 +00:00
parent ec6779b43e
commit 9da5d05f8f
2 changed files with 4 additions and 1 deletions

View File

@ -370,7 +370,7 @@ class Google(callbacks.PluginRegexp):
_calcRe = re.compile(r'<td nowrap><font size=\+1><b>(.*?)</b>', re.I)
_calcSupRe = re.compile(r'<sup>(.*?)</sup>', re.I)
_calcFontRe = re.compile(r'<font size=-2>(.*?)</font>')
_calcTimesRe = re.compile(r'&times;')
_calcTimesRe = re.compile(r'&(?:times|#215);')
def calc(self, irc, msg, args, expr):
"""<expression>

View File

@ -32,6 +32,9 @@ from supybot.test import *
class GoogleTestCase(ChannelPluginTestCase):
plugins = ('Google',)
if network:
def testCalcHandlesMultiplicationSymbol(self):
self.assertNotRegexp('google calc seconds in a century', r'215')
def testCalc(self):
self.assertNotRegexp('google calc e^(i*pi)+1', r'didn\'t')