summaryrefslogtreecommitdiff
path: root/tests/lexers/python
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2021-01-18 21:24:00 +0100
committerGeorg Brandl <georg@python.org>2021-01-18 22:08:36 +0100
commit2a3d3a7d5b9c60dedf6638d876161d9563faebcf (patch)
tree809c0b4a686db98f5954afa1944404cd9652c6b2 /tests/lexers/python
parentf0445be718da83541ea3401aad882f3937147263 (diff)
downloadpygments-git-examplefiles.tar.gz
Move test_examplefiles to new tests/lexers scheme.examplefiles
Diffstat (limited to 'tests/lexers/python')
-rw-r--r--tests/lexers/python/example.txt72
-rw-r--r--tests/lexers/python/example2.txt14
-rw-r--r--tests/lexers/python/example3.txt239
3 files changed, 325 insertions, 0 deletions
diff --git a/tests/lexers/python/example.txt b/tests/lexers/python/example.txt
new file mode 100644
index 00000000..7308d10c
--- /dev/null
+++ b/tests/lexers/python/example.txt
@@ -0,0 +1,72 @@
+---input---
+def foo():
+ ur"""unicode-raw"""
+
+def bar():
+ u"""unicode"""
+
+def baz():
+ r'raw'
+
+def zap():
+ """docstring"""
+
+---tokens---
+'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
diff --git a/tests/lexers/python/example2.txt b/tests/lexers/python/example2.txt
new file mode 100644
index 00000000..40e92f5b
--- /dev/null
+++ b/tests/lexers/python/example2.txt
@@ -0,0 +1,14 @@
+---input---
+class Käse:
+ pass
+
+---tokens---
+'class' Keyword
+' ' Text
+'Käse' Name.Class
+':' Punctuation
+'\n' Text
+
+' ' Text
+'pass' Keyword
+'\n' Text
diff --git a/tests/lexers/python/example3.txt b/tests/lexers/python/example3.txt
new file mode 100644
index 00000000..615005af
--- /dev/null
+++ b/tests/lexers/python/example3.txt
@@ -0,0 +1,239 @@
+---input---
+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
+
+
+
+---tokens---
+'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