Added more tests for the lexer, to make sure stuff within dangling parens is

left alone.
This commit is contained in:
Daniel DiPaolo 2003-11-10 20:25:24 +00:00
parent 9d8d47bbe7
commit 473ce16776

View File

@ -45,6 +45,12 @@ if sqlite is not None:
def testNoBarParens(self): def testNoBarParens(self):
self.assertEqual(MoobotFactoids.tokenize('(foo)'), ['(foo)']) self.assertEqual(MoobotFactoids.tokenize('(foo)'), ['(foo)'])
def testDanglingParens(self):
self.assertEqual(MoobotFactoids.tokenize('(foo'), ['(foo'])
self.assertEqual(MoobotFactoids.tokenize('(foo|bar'),['(foo|bar'])
self.assertEqual(MoobotFactoids.tokenize('foo)'), ['foo)'])
self.assertEqual(MoobotFactoids.tokenize('foo|bar)'),['foo|bar)'])
class FactoidsTestCase(PluginTestCase, PluginDocumentation): class FactoidsTestCase(PluginTestCase, PluginDocumentation):
plugins = ('MoobotFactoids', 'User', 'Utilities') plugins = ('MoobotFactoids', 'User', 'Utilities')
def setUp(self): def setUp(self):