Aka: Add recursivity test.

This commit is contained in:
Valentin Lorentz 2013-07-24 18:23:51 +02:00
parent e68e7f36de
commit d5c0df39f3

View File

@ -53,7 +53,8 @@ class FunctionsTest(SupyTestCase):
self.assertEqual(Aka.findBiggestDollar('$10 bar $1'), 10) self.assertEqual(Aka.findBiggestDollar('$10 bar $1'), 10)
class AkaChannelTestCase(ChannelPluginTestCase): class AkaChannelTestCase(ChannelPluginTestCase):
plugins = ('Aka', 'Filter', 'Utilities', 'Format', 'Reply') plugins = ('Aka', 'Conditional', 'Filter', 'Math', 'Utilities',
'Format', 'Reply')
def testDoesNotOverwriteCommands(self): def testDoesNotOverwriteCommands(self):
# We don't have dispatcher commands anymore # We don't have dispatcher commands anymore
@ -148,6 +149,13 @@ class AkaChannelTestCase(ChannelPluginTestCase):
self.assertResponse('foo bar', 'spam') self.assertResponse('foo bar', 'spam')
self.assertResponse('foo', 'egg') self.assertResponse('foo', 'egg')
def testRecursivity(self):
self.assertNotError('aka add fact '
r'"cif [nceq $1 0] \"echo 1\" '
r'\"calc $1 * [fact [calc $1 - 1]]\""')
self.assertResponse('fact 4', '24')
self.assertRegexp('fact 50', 'more nesting')
class AkaTestCase(PluginTestCase): class AkaTestCase(PluginTestCase):
plugins = ('Aka', 'User') plugins = ('Aka', 'User')