mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-24 03:33:11 +01:00
Added test for rpn 2 degrees and fixed rpn to pass it.
This commit is contained in:
parent
33cd4aa908
commit
f706191201
@ -166,7 +166,10 @@ class Math(callbacks.Privmsg):
|
||||
stack = []
|
||||
for arg in args:
|
||||
try:
|
||||
stack.append(complex(arg))
|
||||
x = complex(arg)
|
||||
if x == abs(x):
|
||||
x = abs(x)
|
||||
stack.append(x)
|
||||
except ValueError: # Not a float.
|
||||
if arg in self._mathEnv:
|
||||
f = self._mathEnv[arg]
|
||||
|
@ -49,6 +49,7 @@ class MathTestCase(PluginTestCase, PluginDocumentation):
|
||||
self.assertResponse('rpn 1 2 3 +', 'Stack: [1, 5]')
|
||||
self.assertResponse('rpn 1 dup', 'Stack: [1, 1]')
|
||||
self.assertResponse('rpn 2 3 4 + -', str(2-7))
|
||||
self.assertNotError('rpn 2 degrees')
|
||||
|
||||
def testConvert(self):
|
||||
self.assertResponse('convert 1 m to cm', '100.0 cm')
|
||||
|
Loading…
Reference in New Issue
Block a user