summaryrefslogtreecommitdiff
path: root/tests/lexers/pytb
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lexers/pytb')
-rw-r--r--tests/lexers/pytb/example.txt175
-rw-r--r--tests/lexers/pytb/example2.txt189
-rw-r--r--tests/lexers/pytb/example3.txt28
-rw-r--r--tests/lexers/pytb/example4.txt16
-rw-r--r--tests/lexers/pytb/example5.txt42
5 files changed, 450 insertions, 0 deletions
diff --git a/tests/lexers/pytb/example.txt b/tests/lexers/pytb/example.txt
new file mode 100644
index 00000000..174a4693
--- /dev/null
+++ b/tests/lexers/pytb/example.txt
@@ -0,0 +1,175 @@
+---input---
+ File "/usr/lib/python2.3/site-packages/trac/web/main.py", line 314, in dispatch_request
+ dispatcher.dispatch(req)
+ File "/usr/lib/python2.3/site-packages/trac/web/main.py", line 186, in dispatch
+ req.session = Session(self.env, req)
+ File "/usr/lib/python2.3/site-packages/trac/web/session.py", line 52, in __init__
+ self.promote_session(sid)
+ File "/usr/lib/python2.3/site-packages/trac/web/session.py", line 125, in promote_session
+ "AND authenticated=0", (sid,))
+ File "/usr/lib/python2.3/site-packages/trac/db/util.py", line 47, in execute
+ return self.cursor.execute(sql_escape_percent(sql), args)
+ File "/usr/lib/python2.3/site-packages/trac/db/sqlite_backend.py", line 44, in execute
+ args or [])
+ File "/usr/lib/python2.3/site-packages/trac/db/sqlite_backend.py", line 36, in _rollback_on_error
+ return function(self, *args, **kwargs)
+OperationalError: database is locked
+
+---tokens---
+'' Generic.Traceback
+' File ' Text
+'"/usr/lib/python2.3/site-packages/trac/web/main.py"' Name.Builtin
+', line ' Text
+'314' Literal.Number
+', in ' Text
+'dispatch_request' Name
+'\n' Text
+
+' ' Text
+'dispatcher' Name
+'.' Operator
+'dispatch' Name
+'(' Punctuation
+'req' Name
+')' Punctuation
+'\n' Text
+
+' File ' Text
+'"/usr/lib/python2.3/site-packages/trac/web/main.py"' Name.Builtin
+', line ' Text
+'186' Literal.Number
+', in ' Text
+'dispatch' Name
+'\n' Text
+
+' ' Text
+'req' Name
+'.' Operator
+'session' Name
+' ' Text
+'=' Operator
+' ' Text
+'Session' Name
+'(' Punctuation
+'self' Name.Builtin.Pseudo
+'.' Operator
+'env' Name
+',' Punctuation
+' ' Text
+'req' Name
+')' Punctuation
+'\n' Text
+
+' File ' Text
+'"/usr/lib/python2.3/site-packages/trac/web/session.py"' Name.Builtin
+', line ' Text
+'52' Literal.Number
+', in ' Text
+'__init__' Name
+'\n' Text
+
+' ' Text
+'self' Name.Builtin.Pseudo
+'.' Operator
+'promote_session' Name
+'(' Punctuation
+'sid' Name
+')' Punctuation
+'\n' Text
+
+' File ' Text
+'"/usr/lib/python2.3/site-packages/trac/web/session.py"' Name.Builtin
+', line ' Text
+'125' Literal.Number
+', in ' Text
+'promote_session' Name
+'\n' Text
+
+' ' Text
+'"' Literal.String.Double
+'AND authenticated=0' Literal.String.Double
+'"' Literal.String.Double
+',' Punctuation
+' ' Text
+'(' Punctuation
+'sid' Name
+',' Punctuation
+')' Punctuation
+')' Punctuation
+'\n' Text
+
+' File ' Text
+'"/usr/lib/python2.3/site-packages/trac/db/util.py"' Name.Builtin
+', line ' Text
+'47' Literal.Number
+', in ' Text
+'execute' Name
+'\n' Text
+
+' ' Text
+'return' Keyword
+' ' Text
+'self' Name.Builtin.Pseudo
+'.' Operator
+'cursor' Name
+'.' Operator
+'execute' Name
+'(' Punctuation
+'sql_escape_percent' Name
+'(' Punctuation
+'sql' Name
+')' Punctuation
+',' Punctuation
+' ' Text
+'args' Name
+')' Punctuation
+'\n' Text
+
+' File ' Text
+'"/usr/lib/python2.3/site-packages/trac/db/sqlite_backend.py"' Name.Builtin
+', line ' Text
+'44' Literal.Number
+', in ' Text
+'execute' Name
+'\n' Text
+
+' ' Text
+'args' Name
+' ' Text
+'or' Operator.Word
+' ' Text
+'[' Punctuation
+']' Punctuation
+')' Punctuation
+'\n' Text
+
+' File ' Text
+'"/usr/lib/python2.3/site-packages/trac/db/sqlite_backend.py"' Name.Builtin
+', line ' Text
+'36' Literal.Number
+', in ' Text
+'_rollback_on_error' Name
+'\n' Text
+
+' ' Text
+'return' Keyword
+' ' Text
+'function' Name
+'(' Punctuation
+'self' Name.Builtin.Pseudo
+',' Punctuation
+' ' Text
+'*' Operator
+'args' Name
+',' Punctuation
+' ' Text
+'*' Operator
+'*' Operator
+'kwargs' Name
+')' Punctuation
+'\n' Text
+
+'OperationalError' Generic.Error
+': ' Text
+'database is locked' Name
+'\n' Text
diff --git a/tests/lexers/pytb/example2.txt b/tests/lexers/pytb/example2.txt
new file mode 100644
index 00000000..f167d803
--- /dev/null
+++ b/tests/lexers/pytb/example2.txt
@@ -0,0 +1,189 @@
+---input---
+Text before
+
+Traceback (most recent call last):
+ File "/usr/lib/python2.3/site-packages/trac/web/main.py", line 314, in dispatch_request
+ dispatcher.dispatch(req)
+ File "/usr/lib/python2.3/site-packages/trac/web/main.py", line 186, in dispatch
+ req.session = Session(self.env, req)
+ File "/usr/lib/python2.3/site-packages/trac/web/session.py", line 52, in __init__
+ self.promote_session(sid)
+ File "/usr/lib/python2.3/site-packages/trac/web/session.py", line 125, in promote_session
+ "AND authenticated=0", (sid,))
+ File "/usr/lib/python2.3/site-packages/trac/db/util.py", line 47, in execute
+ return self.cursor.execute(sql_escape_percent(sql), args)
+ File "/usr/lib/python2.3/site-packages/trac/db/sqlite_backend.py", line 44, in execute
+ args or [])
+ File "/usr/lib/python2.3/site-packages/trac/db/sqlite_backend.py", line 36, in _rollback_on_error
+ return function(self, *args, **kwargs)
+OperationalError: database is locked
+
+Text after
+
+---tokens---
+'Text before\n' Other
+
+'\n' Text
+
+'Traceback (most recent call last):\n' Generic.Traceback
+
+' File ' Text
+'"/usr/lib/python2.3/site-packages/trac/web/main.py"' Name.Builtin
+', line ' Text
+'314' Literal.Number
+', in ' Text
+'dispatch_request' Name
+'\n' Text
+
+' ' Text
+'dispatcher' Name
+'.' Operator
+'dispatch' Name
+'(' Punctuation
+'req' Name
+')' Punctuation
+'\n' Text
+
+' File ' Text
+'"/usr/lib/python2.3/site-packages/trac/web/main.py"' Name.Builtin
+', line ' Text
+'186' Literal.Number
+', in ' Text
+'dispatch' Name
+'\n' Text
+
+' ' Text
+'req' Name
+'.' Operator
+'session' Name
+' ' Text
+'=' Operator
+' ' Text
+'Session' Name
+'(' Punctuation
+'self' Name.Builtin.Pseudo
+'.' Operator
+'env' Name
+',' Punctuation
+' ' Text
+'req' Name
+')' Punctuation
+'\n' Text
+
+' File ' Text
+'"/usr/lib/python2.3/site-packages/trac/web/session.py"' Name.Builtin
+', line ' Text
+'52' Literal.Number
+', in ' Text
+'__init__' Name
+'\n' Text
+
+' ' Text
+'self' Name.Builtin.Pseudo
+'.' Operator
+'promote_session' Name
+'(' Punctuation
+'sid' Name
+')' Punctuation
+'\n' Text
+
+' File ' Text
+'"/usr/lib/python2.3/site-packages/trac/web/session.py"' Name.Builtin
+', line ' Text
+'125' Literal.Number
+', in ' Text
+'promote_session' Name
+'\n' Text
+
+' ' Text
+'"' Literal.String.Double
+'AND authenticated=0' Literal.String.Double
+'"' Literal.String.Double
+',' Punctuation
+' ' Text
+'(' Punctuation
+'sid' Name
+',' Punctuation
+')' Punctuation
+')' Punctuation
+'\n' Text
+
+' File ' Text
+'"/usr/lib/python2.3/site-packages/trac/db/util.py"' Name.Builtin
+', line ' Text
+'47' Literal.Number
+', in ' Text
+'execute' Name
+'\n' Text
+
+' ' Text
+'return' Keyword
+' ' Text
+'self' Name.Builtin.Pseudo
+'.' Operator
+'cursor' Name
+'.' Operator
+'execute' Name
+'(' Punctuation
+'sql_escape_percent' Name
+'(' Punctuation
+'sql' Name
+')' Punctuation
+',' Punctuation
+' ' Text
+'args' Name
+')' Punctuation
+'\n' Text
+
+' File ' Text
+'"/usr/lib/python2.3/site-packages/trac/db/sqlite_backend.py"' Name.Builtin
+', line ' Text
+'44' Literal.Number
+', in ' Text
+'execute' Name
+'\n' Text
+
+' ' Text
+'args' Name
+' ' Text
+'or' Operator.Word
+' ' Text
+'[' Punctuation
+']' Punctuation
+')' Punctuation
+'\n' Text
+
+' File ' Text
+'"/usr/lib/python2.3/site-packages/trac/db/sqlite_backend.py"' Name.Builtin
+', line ' Text
+'36' Literal.Number
+', in ' Text
+'_rollback_on_error' Name
+'\n' Text
+
+' ' Text
+'return' Keyword
+' ' Text
+'function' Name
+'(' Punctuation
+'self' Name.Builtin.Pseudo
+',' Punctuation
+' ' Text
+'*' Operator
+'args' Name
+',' Punctuation
+' ' Text
+'*' Operator
+'*' Operator
+'kwargs' Name
+')' Punctuation
+'\n' Text
+
+'OperationalError' Generic.Error
+': ' Text
+'database is locked' Name
+'\n' Text
+
+'\n' Text
+
+'Text after\n' Other
diff --git a/tests/lexers/pytb/example3.txt b/tests/lexers/pytb/example3.txt
new file mode 100644
index 00000000..495e5b92
--- /dev/null
+++ b/tests/lexers/pytb/example3.txt
@@ -0,0 +1,28 @@
+---input---
+ File "<stdin>", line 1
+ 1+
+ ^
+SyntaxError: invalid syntax
+
+---tokens---
+'' Generic.Traceback
+' File ' Text
+'"<stdin>"' Name.Builtin
+', line ' Text
+'1' Literal.Number
+'\n' Text
+
+' ' Text
+'1' Literal.Number.Integer
+'+' Operator
+'\n' Text
+
+' ' Text
+' ' Text
+'^' Operator
+'\n' Text
+
+'SyntaxError' Generic.Error
+': ' Text
+'invalid syntax' Name
+'\n' Text
diff --git a/tests/lexers/pytb/example4.txt b/tests/lexers/pytb/example4.txt
new file mode 100644
index 00000000..ed84ad7a
--- /dev/null
+++ b/tests/lexers/pytb/example4.txt
@@ -0,0 +1,16 @@
+---input---
+ File "temp.py", line 1
+SyntaxError: Non-ASCII character '\xc3' in file temp.py on line 1, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details
+
+---tokens---
+'' Generic.Traceback
+' File ' Text
+'"temp.py"' Name.Builtin
+', line ' Text
+'1' Literal.Number
+'\n' Text
+
+'SyntaxError' Generic.Error
+': ' Text
+"Non-ASCII character '\\xc3' in file temp.py on line 1, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details" Name
+'\n' Text
diff --git a/tests/lexers/pytb/example5.txt b/tests/lexers/pytb/example5.txt
new file mode 100644
index 00000000..0de33a5f
--- /dev/null
+++ b/tests/lexers/pytb/example5.txt
@@ -0,0 +1,42 @@
+---input---
+>>> 3/"3"
+Traceback (most recent call last):
+ File "<stdin>", line 1, in <module>
+TypeError: unsupported operand type(s) for /: 'int' and 'str'
+>>> blah
+Traceback (most recent call last):
+ File "<stdin>", line 1, in <module>
+builtins.NameError
+
+---tokens---
+'>>> 3/"3"\n' Other
+
+'Traceback (most recent call last):\n' Generic.Traceback
+
+' File ' Text
+'"<stdin>"' Name.Builtin
+', line ' Text
+'1' Literal.Number
+', in ' Text
+'<module>' Name
+'\n' Text
+
+'TypeError' Generic.Error
+': ' Text
+"unsupported operand type(s) for /: 'int' and 'str'" Name
+'\n' Text
+
+'>>> blah\n' Other
+
+'Traceback (most recent call last):\n' Generic.Traceback
+
+' File ' Text
+'"<stdin>"' Name.Builtin
+', line ' Text
+'1' Literal.Number
+', in ' Text
+'<module>' Name
+'\n' Text
+
+'builtins.NameError' Generic.Error
+'\n' Text