summaryrefslogtreecommitdiff
path: root/tests/examplefiles/python
diff options
context:
space:
mode:
Diffstat (limited to 'tests/examplefiles/python')
-rw-r--r--tests/examplefiles/python/linecontinuation.py47
-rw-r--r--tests/examplefiles/python/linecontinuation.py.output189
-rw-r--r--tests/examplefiles/python/py3_test.txt2
-rw-r--r--tests/examplefiles/python/py3_test.txt.output9
-rw-r--r--tests/examplefiles/python/unicodedoc.py11
-rw-r--r--tests/examplefiles/python/unicodedoc.py.output58
6 files changed, 316 insertions, 0 deletions
diff --git a/tests/examplefiles/python/linecontinuation.py b/tests/examplefiles/python/linecontinuation.py
new file mode 100644
index 00000000..2a41c31c
--- /dev/null
+++ b/tests/examplefiles/python/linecontinuation.py
@@ -0,0 +1,47 @@
+apple.filter(x, y)
+apple.\
+ filter(x, y)
+
+1 \
+ . \
+ __str__
+
+from os import path
+from \
+ os \
+ import \
+ path
+
+import os.path as something
+
+import \
+ os.path \
+ as \
+ something
+
+class \
+ Spam:
+ pass
+
+class Spam: pass
+
+class Spam(object):
+ pass
+
+class \
+ Spam \
+ (
+ object
+ ) \
+ :
+ pass
+
+
+def \
+ spam \
+ ( \
+ ) \
+ : \
+ pass
+
+
diff --git a/tests/examplefiles/python/linecontinuation.py.output b/tests/examplefiles/python/linecontinuation.py.output
new file mode 100644
index 00000000..78680c3e
--- /dev/null
+++ b/tests/examplefiles/python/linecontinuation.py.output
@@ -0,0 +1,189 @@
+'apple' Name
+'.' Operator
+'filter' Name
+'(' Punctuation
+'x' Name
+',' Punctuation
+' ' Text
+'y' Name
+')' Punctuation
+'\n' Text
+
+'apple' Name
+'.' Operator
+'\\\n' Text
+
+' ' Text
+'filter' Name.Builtin
+'(' Punctuation
+'x' Name
+',' Punctuation
+' ' Text
+'y' Name
+')' Punctuation
+'\n' Text
+
+'\n' Text
+
+'1' Literal.Number.Integer
+' ' Text
+'\\\n' Text
+
+' ' Text
+'.' Operator
+' ' Text
+'\\\n' Text
+
+' ' Text
+'__str__' Name.Function.Magic
+'\n' Text
+
+'\n' Text
+
+'from' Keyword.Namespace
+' ' Text
+'os' Name.Namespace
+' ' Text
+'import' Keyword.Namespace
+' ' Text
+'path' Name
+'\n' Text
+
+'from' Keyword.Namespace
+' \\\n ' Text
+'os' Name.Namespace
+' ' Text
+'\\\n' Text
+
+' ' Text
+'import' Keyword.Namespace
+' \\\n ' Text
+'path' Name.Namespace
+'\n' Text
+
+'\n' Text
+
+'import' Keyword.Namespace
+' ' Text
+'os' Name.Namespace
+'.' Name.Namespace
+'path' Name.Namespace
+' ' Text
+'as' Keyword
+' ' Text
+'something' Name.Namespace
+'\n' Text
+
+'\n' Text
+
+'import' Keyword.Namespace
+' \\\n ' Text
+'os' Name.Namespace
+'.' Name.Namespace
+'path' Name.Namespace
+' ' Text
+'\\\n' Text
+
+' ' Text
+'as' Keyword
+' ' Text
+'\\\n' Text
+
+' ' Text
+'something' Name
+'\n' Text
+
+'\n' Text
+
+'class' Keyword
+' \\\n ' Text
+'Spam' Name.Class
+':' Punctuation
+'\n' Text
+
+' ' Text
+'pass' Keyword
+'\n' Text
+
+'\n' Text
+
+'class' Keyword
+' ' Text
+'Spam' Name.Class
+':' Punctuation
+' ' Text
+'pass' Keyword
+'\n' Text
+
+'\n' Text
+
+'class' Keyword
+' ' Text
+'Spam' Name.Class
+'(' Punctuation
+'object' Name.Builtin
+')' Punctuation
+':' Punctuation
+'\n' Text
+
+' ' Text
+'pass' Keyword
+'\n' Text
+
+'\n' Text
+
+'class' Keyword
+' \\\n ' Text
+'Spam' Name.Class
+' ' Text
+'\\\n' Text
+
+' ' Text
+'(' Punctuation
+'\n' Text
+
+' ' Text
+'object' Name.Builtin
+'\n' Text
+
+' ' Text
+')' Punctuation
+' ' Text
+'\\\n' Text
+
+' ' Text
+':' Punctuation
+'\n' Text
+
+' ' Text
+'pass' Keyword
+'\n' Text
+
+'\n' Text
+
+'\n' Text
+
+'def' Keyword
+' \\\n ' Text
+'spam' Name.Function
+' ' Text
+'\\\n' Text
+
+' ' Text
+'(' Punctuation
+' ' Text
+'\\\n' Text
+
+' ' Text
+')' Punctuation
+' ' Text
+'\\\n' Text
+
+' ' Text
+':' Punctuation
+' ' Text
+'\\\n' Text
+
+' ' Text
+'pass' Keyword
+'\n' Text
diff --git a/tests/examplefiles/python/py3_test.txt b/tests/examplefiles/python/py3_test.txt
new file mode 100644
index 00000000..21fea754
--- /dev/null
+++ b/tests/examplefiles/python/py3_test.txt
@@ -0,0 +1,2 @@
+class Käse:
+ pass
diff --git a/tests/examplefiles/python/py3_test.txt.output b/tests/examplefiles/python/py3_test.txt.output
new file mode 100644
index 00000000..785c1695
--- /dev/null
+++ b/tests/examplefiles/python/py3_test.txt.output
@@ -0,0 +1,9 @@
+'class' Keyword
+' ' Text
+'Käse' Name.Class
+':' Punctuation
+'\n' Text
+
+' ' Text
+'pass' Keyword
+'\n' Text
diff --git a/tests/examplefiles/python/unicodedoc.py b/tests/examplefiles/python/unicodedoc.py
new file mode 100644
index 00000000..9d3db0c8
--- /dev/null
+++ b/tests/examplefiles/python/unicodedoc.py
@@ -0,0 +1,11 @@
+def foo():
+ ur"""unicode-raw"""
+
+def bar():
+ u"""unicode"""
+
+def baz():
+ r'raw'
+
+def zap():
+ """docstring"""
diff --git a/tests/examplefiles/python/unicodedoc.py.output b/tests/examplefiles/python/unicodedoc.py.output
new file mode 100644
index 00000000..0d40ef21
--- /dev/null
+++ b/tests/examplefiles/python/unicodedoc.py.output
@@ -0,0 +1,58 @@
+'def' Keyword
+' ' Text
+'foo' Name.Function
+'(' Punctuation
+')' Punctuation
+':' Punctuation
+'\n' Text
+
+' ' Text
+'ur' Literal.String.Affix
+'"""unicode-raw"""' Literal.String.Doc
+'\n' Text
+
+'\n' Text
+
+'def' Keyword
+' ' Text
+'bar' Name.Function
+'(' Punctuation
+')' Punctuation
+':' Punctuation
+'\n' Text
+
+' ' Text
+'u' Literal.String.Affix
+'"""unicode"""' Literal.String.Doc
+'\n' Text
+
+'\n' Text
+
+'def' Keyword
+' ' Text
+'baz' Name.Function
+'(' Punctuation
+')' Punctuation
+':' Punctuation
+'\n' Text
+
+' ' Text
+'r' Literal.String.Affix
+"'" Literal.String.Single
+'raw' Literal.String.Single
+"'" Literal.String.Single
+'\n' Text
+
+'\n' Text
+
+'def' Keyword
+' ' Text
+'zap' Name.Function
+'(' Punctuation
+')' Punctuation
+':' Punctuation
+'\n' Text
+
+' ' Text
+'"""docstring"""' Literal.String.Doc
+'\n' Text