File: test_whiley.py

package info (click to toggle)
pygments 2.2.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 4,628 kB
  • ctags: 5,425
  • sloc: python: 69,950; makefile: 217; sh: 117
file content (30 lines) | stat: -rw-r--r-- 761 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# -*- coding: utf-8 -*-
"""
    Whiley Test
    ~~~~~~~~~~~

    :copyright: Copyright 2006-2016 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
"""

import unittest

from pygments.lexers import WhileyLexer
from pygments.token import Token


class WhileyTest(unittest.TestCase):
    def setUp(self):
        self.lexer = WhileyLexer()

    def testWhileyOperator(self):
        fragment = u'123 \u2200 x\n'
        tokens = [
            (Token.Literal.Number.Integer, u'123'),
            (Token.Text, u' '),
            (Token.Operator, u'\u2200'),
            (Token.Text, u' '),
            (Token.Name, u'x'),
            (Token.Text, u'\n'),
        ]
        self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))