diff options
author | Tim Hatch <tim@timhatch.com> | 2014-04-23 16:48:10 -0400 |
---|---|---|
committer | Tim Hatch <tim@timhatch.com> | 2014-04-23 16:48:10 -0400 |
commit | 690a2bdfa924f76fd374e25bd9772c2090cf6414 (patch) | |
tree | 576991298817f1055da24857df6982dc2bd37d5a /tests/test_regexlexer.py | |
parent | 1d9f7f4f19c49a22ecd119f58580f9bc5ccd5080 (diff) | |
parent | b69477dc22e228cde4c1d39bf11b292b88d95fe1 (diff) | |
download | pygments-690a2bdfa924f76fd374e25bd9772c2090cf6414.tar.gz |
Merged in lefticus/pygments-main (pull request #24)
Conflicts:
pygments/lexers/_mapping.py
pygments/lexers/agile.py
Diffstat (limited to 'tests/test_regexlexer.py')
-rw-r--r-- | tests/test_regexlexer.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/test_regexlexer.py b/tests/test_regexlexer.py index f9c1b7ac..b12dce0a 100644 --- a/tests/test_regexlexer.py +++ b/tests/test_regexlexer.py @@ -3,7 +3,7 @@ Pygments regex lexer tests ~~~~~~~~~~~~~~~~~~~~~~~~~~ - :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -11,6 +11,7 @@ import unittest from pygments.token import Text from pygments.lexer import RegexLexer +from pygments.lexer import bygroups class TestLexer(RegexLexer): @@ -34,6 +35,13 @@ class TupleTransTest(unittest.TestCase): def test(self): lx = TestLexer() toks = list(lx.get_tokens_unprocessed('abcde')) - self.assertEquals(toks, + self.assertEqual(toks, [(0, Text.Root, 'a'), (1, Text.Rag, 'b'), (2, Text.Rag, 'c'), (3, Text.Beer, 'd'), (4, Text.Root, 'e')]) + + def test_multiline(self): + lx = TestLexer() + toks = list(lx.get_tokens_unprocessed('a\ne')) + self.assertEqual(toks, + [(0, Text.Root, 'a'), (1, Text, u'\n'), + (2, Text.Root, 'e')]) |