mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-12 13:12:35 +01:00
Fix for bug #842414.
This commit is contained in:
parent
27ce432b64
commit
320d6b003c
@ -94,7 +94,7 @@ class Math(callbacks.Privmsg):
|
|||||||
if imag == 0:
|
if imag == 0:
|
||||||
return str(real)
|
return str(real)
|
||||||
elif imag == 1:
|
elif imag == 1:
|
||||||
imag = 'i'
|
imag = '+i'
|
||||||
elif imag == -1:
|
elif imag == -1:
|
||||||
imag = '-i'
|
imag = '-i'
|
||||||
elif imag < 0:
|
elif imag < 0:
|
||||||
|
@ -50,6 +50,9 @@ class MathTestCase(PluginTestCase, PluginDocumentation):
|
|||||||
def testCalcNoNameError(self):
|
def testCalcNoNameError(self):
|
||||||
self.assertNotRegexp('calc foobar(x)', 'NameError')
|
self.assertNotRegexp('calc foobar(x)', 'NameError')
|
||||||
|
|
||||||
|
def testCalcImaginary(self):
|
||||||
|
self.assertResponse('calc 3 + sqrt(-1)', '3+i')
|
||||||
|
|
||||||
def testRpn(self):
|
def testRpn(self):
|
||||||
self.assertResponse('rpn 5 2 +', '7')
|
self.assertResponse('rpn 5 2 +', '7')
|
||||||
self.assertResponse('rpn 1 2 3 +', 'Stack: [1, 5]')
|
self.assertResponse('rpn 1 2 3 +', 'Stack: [1, 5]')
|
||||||
|
Loading…
Reference in New Issue
Block a user