diff options
Diffstat (limited to '')
-rw-r--r-- | tests/test_thingsdb.py | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/test_thingsdb.py b/tests/test_thingsdb.py new file mode 100644 index 0000000..25e3816 --- /dev/null +++ b/tests/test_thingsdb.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +""" + Basic ThingsDB Test + ~~~~~~~~~~~~~~~~~~~~ + + :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import unittest + +from pygments.token import Number, Text, Comment +from pygments.lexers import ThingsDBLexer + + +class ThingsDBTest(unittest.TestCase): + + def setUp(self): + self.lexer = ThingsDBLexer() + self.maxDiff = None + + def testNumber(self): + fragment = u'42' + tokens = [ + (Number.Integer, u'42'), + (Text.Whitespace, '\n') + ] + self.assertEqual(tokens, list(self.lexer.get_tokens(fragment))) + + def testThingId(self): + fragment = u'#42' + tokens = [ + (Comment.Preproc, u'#42'), + (Text.Whitespace, '\n') + ] + self.assertEqual(tokens, list(self.lexer.get_tokens(fragment))) |