This commit is contained in:
Jeremy Fincher 2003-11-15 08:09:29 +00:00
parent 27ce432b64
commit 320d6b003c
2 changed files with 4 additions and 1 deletions

View File

@ -94,7 +94,7 @@ class Math(callbacks.Privmsg):
if imag == 0:
return str(real)
elif imag == 1:
imag = 'i'
imag = '+i'
elif imag == -1:
imag = '-i'
elif imag < 0:

View File

@ -49,6 +49,9 @@ class MathTestCase(PluginTestCase, PluginDocumentation):
def testCalcNoNameError(self):
self.assertNotRegexp('calc foobar(x)', 'NameError')
def testCalcImaginary(self):
self.assertResponse('calc 3 + sqrt(-1)', '3+i')
def testRpn(self):
self.assertResponse('rpn 5 2 +', '7')