summaryrefslogtreecommitdiff
path: root/tests/test_shell.py
diff options
context:
space:
mode:
authorMiro Hron?ok <miro@hroncok.cz>2017-09-22 13:07:39 +0200
committerMiro Hron?ok <miro@hroncok.cz>2017-09-22 13:07:39 +0200
commit7c360cd4355828b556d107707e8d6ce56735494d (patch)
tree36943e280f860afeb96eac61e24b115cc1d1a5ca /tests/test_shell.py
parent1b966038502c0b386a6645d4b5125f623d0947bb (diff)
downloadpygments-git-7c360cd4355828b556d107707e8d6ce56735494d.tar.gz
Recognize single > as a prompt in doscon
Fixes https://bitbucket.org/birkenfeld/pygments-main/issues/1380/lexer-for-cmdexe-interactive-session-with
Diffstat (limited to 'tests/test_shell.py')
-rw-r--r--tests/test_shell.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/test_shell.py b/tests/test_shell.py
index e283793e..1121240a 100644
--- a/tests/test_shell.py
+++ b/tests/test_shell.py
@@ -10,7 +10,7 @@
import unittest
from pygments.token import Token
-from pygments.lexers import BashLexer, BashSessionLexer
+from pygments.lexers import BashLexer, BashSessionLexer, MSDOSSessionLexer
class BashTest(unittest.TestCase):
@@ -140,3 +140,20 @@ class BashSessionTest(unittest.TestCase):
]
self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
+class MSDOSSessionTest(unittest.TestCase):
+
+ def setUp(self):
+ self.lexer = MSDOSSessionLexer()
+
+ def testGtOnlyPrompt(self):
+ fragment = u'> py\nhi\n'
+ tokens = [
+ (Token.Text, u''),
+ (Token.Generic.Prompt, u'>'),
+ (Token.Text, u' '),
+ (Token.Text, u'py'),
+ (Token.Text, u''),
+ (Token.Text, u'\n'),
+ (Token.Generic.Output, u'hi\n'),
+ ]
+ self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))