summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAnteru <bitbucket@ca.sh13.net>2019-05-09 05:33:40 +0000
committerAnteru <bitbucket@ca.sh13.net>2019-05-09 05:33:40 +0000
commit39180ec55da3d008f29d335e0d78b59e36148813 (patch)
tree508741f153294681cae195c58d2a2f21fa43ab94 /tests
parent41f5b07a3b9e099b3895eb6f239f8007156b2a84 (diff)
parent541c30ceb87355a7414e4dbfbcaf849371839751 (diff)
downloadpygments-39180ec55da3d008f29d335e0d78b59e36148813.tar.gz
Merged in hroncok/pygments-main/doscon_prompt (pull request #734)
Recognize single > as a prompt in doscon
Diffstat (limited to 'tests')
-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)))