From d5c0df39f3853d16b29d1847698f746363eb69e3 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Wed, 24 Jul 2013 18:23:51 +0200 Subject: [PATCH] Aka: Add recursivity test. --- plugins/Aka/test.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/plugins/Aka/test.py b/plugins/Aka/test.py index 1b4dbec0d..d386ce312 100644 --- a/plugins/Aka/test.py +++ b/plugins/Aka/test.py @@ -53,7 +53,8 @@ class FunctionsTest(SupyTestCase): self.assertEqual(Aka.findBiggestDollar('$10 bar $1'), 10) class AkaChannelTestCase(ChannelPluginTestCase): - plugins = ('Aka', 'Filter', 'Utilities', 'Format', 'Reply') + plugins = ('Aka', 'Conditional', 'Filter', 'Math', 'Utilities', + 'Format', 'Reply') def testDoesNotOverwriteCommands(self): # We don't have dispatcher commands anymore @@ -148,6 +149,13 @@ class AkaChannelTestCase(ChannelPluginTestCase): self.assertResponse('foo bar', 'spam') 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): plugins = ('Aka', 'User')