summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_shell.py1
-rw-r--r--tests/test_template.py28
2 files changed, 28 insertions, 1 deletions
diff --git a/tests/test_shell.py b/tests/test_shell.py
index b3600a4e..a39c0f20 100644
--- a/tests/test_shell.py
+++ b/tests/test_shell.py
@@ -162,7 +162,6 @@ def test_msdos_gt_only(lexer_msdos):
(Token.Generic.Prompt, '>'),
(Token.Text, ' '),
(Token.Text, 'py'),
- (Token.Text, ''),
(Token.Text, '\n'),
(Token.Generic.Output, 'hi\n'),
]
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