diff options
Diffstat (limited to 'tests/test_template.py')
-rw-r--r-- | tests/test_template.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/test_template.py b/tests/test_template.py new file mode 100644 index 00000000..9ae87171 --- /dev/null +++ b/tests/test_template.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +"""Test template formats.""" + +import textwrap +import pytest + +from pygments.lexers import Angular2HtmlLexer +from pygments.token import Token + +@pytest.fixture(scope='module') +def lexer_ng2(): + yield Angular2HtmlLexer() + + +def testAngularFragment(lexer_ng2): + # Not starting with v makes this test work (remove the first token from + # tokens in that case) + fragment = 'v*39j5Sq=' + tokens = [ + (Token.Text, 'v'), + (Token.Punctuation, '*'), + (Token.Name.Attribute, '39j5Sq'), + (Token.Operator, '='), + (Token.Text, '\n') + ] + assert list(lexer_ng2.get_tokens(fragment)) == tokens
\ No newline at end of file |