summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMatthäus G. Chajdas <dev@anteru.net>2020-08-22 15:47:03 +0200
committerMatthäus G. Chajdas <dev@anteru.net>2020-08-22 15:47:03 +0200
commita57edeccc6b6325e4234f128aac349ee037bd9a4 (patch)
tree0da0e61e7c75409ff7c04b033a6b3e7fb5bb410c /tests
parentf59621498e6dc479e4a40caca93f907529756f01 (diff)
downloadpygments-git-a57edeccc6b6325e4234f128aac349ee037bd9a4.tar.gz
Manually merge PR#1497.
This is a manual merge as we don't want to pull in the documentation change as part of this fix for a cleaner history.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_shell.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/test_shell.py b/tests/test_shell.py
index 753a37e3..42814a0b 100644
--- a/tests/test_shell.py
+++ b/tests/test_shell.py
@@ -179,6 +179,24 @@ def test_powershell_session(lexer_powershell_session):
]
assert list(lexer_powershell_session.get_tokens(fragment)) == tokens
+ fragment = u'PS> Get-ChildItem\n'
+ tokens = [
+ (Token.Name.Builtin, u''),
+ (Token.Generic.Prompt, u'PS> '),
+ (Token.Name.Builtin, u'Get-ChildItem'),
+ (Token.Text, u'\n')
+ ]
+ assert list(lexer_powershell_session.get_tokens(fragment)) == tokens
+
+ fragment = u'PS > Get-ChildItem\n'
+ tokens = [
+ (Token.Name.Builtin, u''),
+ (Token.Generic.Prompt, u'PS > '),
+ (Token.Name.Builtin, u'Get-ChildItem'),
+ (Token.Text, u'\n')
+ ]
+ assert list(lexer_powershell_session.get_tokens(fragment)) == tokens
+
def test_powershell_remoting_session(lexer_powershell_session):
fragment = u'[Long-NetBIOS-Hostname]: PS C:\\> Get-ChildItem\n'