diff options
author | Anteru <bitbucket@ca.sh13.net> | 2019-05-09 05:33:40 +0000 |
---|---|---|
committer | Anteru <bitbucket@ca.sh13.net> | 2019-05-09 05:33:40 +0000 |
commit | 39180ec55da3d008f29d335e0d78b59e36148813 (patch) | |
tree | 508741f153294681cae195c58d2a2f21fa43ab94 /tests | |
parent | 41f5b07a3b9e099b3895eb6f239f8007156b2a84 (diff) | |
parent | 541c30ceb87355a7414e4dbfbcaf849371839751 (diff) | |
download | pygments-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.py | 19 |
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))) |