summaryrefslogtreecommitdiff
path: root/tests/test_basic_api.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_basic_api.py')
-rw-r--r--tests/test_basic_api.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/test_basic_api.py b/tests/test_basic_api.py
index 05d1f490..05371130 100644
--- a/tests/test_basic_api.py
+++ b/tests/test_basic_api.py
@@ -13,6 +13,7 @@ import random
from pygments import lexers, formatters, format
from pygments.token import _TokenType
+from pygments.lexer import RegexLexer
test_content = [chr(i) for i in xrange(33, 128)] * 5
random.shuffle(test_content)
@@ -35,6 +36,9 @@ class LexersTest(unittest.TestCase):
result = lexer.analyse_text("abc")
a(isinstance(result, float) and 0.0 <= result <= 1.0)
+ if issubclass(lexer, RegexLexer):
+ a('root' in lexer._tokens, '%s has no root state' % lexer)
+
inst = lexer(opt1="val1", opt2="val2")
tokens = list(inst.get_tokens(test_content))
txt = ""