| Index: tools/lexer_generator/lexer_test.py
|
| diff --git a/tools/lexer_generator/lexer_test.py b/tools/lexer_generator/lexer_test.py
|
| index f2c4159e0b5f948b614e27611393d85b76edec4f..587acbbeaed3932951353a8212b7eed2714bdcce 100644
|
| --- a/tools/lexer_generator/lexer_test.py
|
| +++ b/tools/lexer_generator/lexer_test.py
|
| @@ -26,16 +26,18 @@
|
| # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
| import unittest
|
| +from automaton import Action
|
| from rule_parser import RuleProcessor
|
|
|
| class LexerTestCase(unittest.TestCase):
|
|
|
| - def __verify_action_stream(self, rules, string, expected_stream):
|
| - expected_stream.append(('terminate', '\0'))
|
| + def __verify_action_stream(self, rules, string, expected):
|
| + expected = map(lambda (action, s) : (Action('code', action), s), expected)
|
| + expected.append((Action('terminate'), '\0'))
|
| rule_processor = RuleProcessor.parse(rules)
|
| for i, (action, start, stop) in enumerate(rule_processor.lex(string)):
|
| - self.assertEquals(expected_stream[i][0], action)
|
| - self.assertEquals(expected_stream[i][1], string[start : stop])
|
| + self.assertEquals(expected[i][0], action)
|
| + self.assertEquals(expected[i][1], string[start : stop])
|
|
|
| def test_simple(self):
|
| rules = '''
|
|
|