Sha256: 5af86a945222111b76fd18fff3b2b7f69dca6fef3e234b4f48355764eca14c0e

Contents?: true

Size: 1.4 KB

Versions: 5

Compression:

Stored size: 1.4 KB

Contents

# -*- 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)))

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
tdiary-4.2.1 vendor/bundle/ruby/2.2.0/gems/pygments.rb-0.6.3/vendor/pygments-main/tests/test_cfm.py
pygments.rb-0.6.3 vendor/pygments-main/tests/test_cfm.py
pygments.rb-0.6.2 vendor/pygments-main/tests/test_cfm.py
pygments.rb-0.6.1 vendor/pygments-main/tests/test_cfm.py
pygments.rb-0.6.0 vendor/pygments-main/tests/test_cfm.py