summaryrefslogtreecommitdiff
path: root/tests/test_basic_api.py
diff options
context:
space:
mode:
authorgbrandl <devnull@localhost>2007-01-08 19:13:39 +0100
committergbrandl <devnull@localhost>2007-01-08 19:13:39 +0100
commit6342c41108da146a0bb14ecbf812a4ebcb27bec8 (patch)
tree1046355f9e20250b170363d585aacc8d7313111d /tests/test_basic_api.py
parent8c5979eab20c8927ff4d872f82c74d21d9ee6b15 (diff)
downloadpygments-6342c41108da146a0bb14ecbf812a4ebcb27bec8.tar.gz
[svn] Fix #178 and make test suite pass.
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 = ""