ยปCore Development>Code coverage>Misc/Vim/syntax_test.py

Python code coverage for Misc/Vim/syntax_test.py

#countcontent
1n/a"""Test file for syntax highlighting of editors.
2n/a
3n/aMeant to cover a wide range of different types of statements and expressions.
4n/aNot necessarily sensical or comprehensive (assume that if one exception is
5n/ahighlighted that all are, for instance).
6n/a
7n/aExtraneous trailing whitespace can't be tested because of svn pre-commit hook
8n/achecks for such things.
9n/a
10n/a"""
11n/a# Comment
12n/a# OPTIONAL: XXX catch your attention
13n/a
14n/a# Statements
15n/afrom __future__ import with_statement # Import
16n/afrom sys import path as thing
17n/aassert True # keyword
18n/adef foo(): # function definition
19n/a return []
20n/aclass Bar(object): # Class definition
21n/a def __enter__(self):
22n/a pass
23n/a def __exit__(self, *args):
24n/a pass
25n/afoo() # UNCOLOURED: function call
26n/awhile False: # 'while'
27n/a continue
28n/afor x in foo(): # 'for'
29n/a break
30n/awith Bar() as stuff:
31n/a pass
32n/aif False: pass # 'if'
33n/aelif False: pass
34n/aelse: pass
35n/a
36n/a# Constants
37n/a'single-quote', u'unicode' # Strings of all kinds; prefixes not highlighted
38n/a"double-quote"
39n/a"""triple double-quote"""
40n/a'''triple single-quote'''
41n/ar'raw'
42n/aur'unicode raw'
43n/a'escape\n'
44n/a'\04' # octal
45n/a'\xFF' # hex
46n/a'\u1111' # unicode character
47n/a1 # Integral
48n/a1L
49n/a1.0 # Float
50n/a.1
51n/a1+2j # Complex
52n/a
53n/a# Expressions
54n/a1 and 2 or 3 # Boolean operators
55n/a2 < 3 # UNCOLOURED: comparison operators
56n/aspam = 42 # UNCOLOURED: assignment
57n/a2 + 3 # UNCOLOURED: number operators
58n/a[] # UNCOLOURED: list
59n/a{} # UNCOLOURED: dict
60n/a(1,) # UNCOLOURED: tuple
61n/aall # Built-in functions
62n/aGeneratorExit # Exceptions