diff options
author | Gaurav Jain <gaurav@gauravjain.org> | 2014-05-10 23:50:58 -0400 |
---|---|---|
committer | Gaurav Jain <gaurav@gauravjain.org> | 2014-05-10 23:50:58 -0400 |
commit | e1f88dcdb9733044ab793866e25f1a5810c926fa (patch) | |
tree | 92c54052c68069b99777545a2066859d7e2964b2 /tests/test_cfm.py | |
parent | 356cc596915bc87e2e0ceca865dd018b3b33522c (diff) | |
download | pygments-e1f88dcdb9733044ab793866e25f1a5810c926fa.tar.gz |
Add cfm unit tests
Diffstat (limited to 'tests/test_cfm.py')
-rw-r--r-- | tests/test_cfm.py | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/tests/test_cfm.py b/tests/test_cfm.py new file mode 100644 index 00000000..2ff25bd6 --- /dev/null +++ b/tests/test_cfm.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +""" + Basic ColdfusionHtmlLexer Test + ~~~~~~~~~~~~~~~~~ + + :copyright: Copyright 2014 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import unittest +import os + +from pygments.token import Token +from pygments.lexers import ColdfusionHtmlLexer + + +class ColdfusionHtmlLexerTest(unittest.TestCase): + + def setUp(self): + self.lexer = ColdfusionHtmlLexer() + + def testBasicComment(self): + fragment = u'<!--- cfcomment --->' + expected = [ + (Token.Text, u''), + (Token.Comment.Multiline, u'<!---'), + (Token.Comment.Multiline, u' cfcomment '), + (Token.Comment.Multiline, u'--->'), + (Token.Text, u'\n'), + ] + self.assertEqual(expected, list(self.lexer.get_tokens(fragment))) + + def testNestedComment(self): + fragment = u'<!--- nested <!--- cfcomment ---> --->' + expected = [ + (Token.Text, u''), + (Token.Comment.Multiline, u'<!---'), + (Token.Comment.Multiline, u' nested '), + (Token.Comment.Multiline, u'<!---'), + (Token.Comment.Multiline, u' cfcomment '), + (Token.Comment.Multiline, u'--->'), + (Token.Comment.Multiline, u' '), + (Token.Comment.Multiline, u'--->'), + (Token.Text, u'\n'), + ] + self.assertEqual(expected, list(self.lexer.get_tokens(fragment))) |