summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/test_completion.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/test_completion.py b/tests/test_completion.py
index 95487641..a7a90941 100644
--- a/tests/test_completion.py
+++ b/tests/test_completion.py
@@ -208,6 +208,19 @@ def test_shell_command_completion(cmd2_app):
begidx = endidx - len(text)
assert cmd2_app.complete_shell(text, line, begidx, endidx) == expected
+def test_shell_command_completion_quotes(cmd2_app):
+ if sys.platform == "win32":
+ text = 'calc'
+ expected = ['calc.exe" ']
+ else:
+ text = 'egr'
+ expected = ['egrep" ']
+
+ line = 'shell "{}'.format(text)
+ endidx = len(line)
+ begidx = endidx - len(text)
+ assert cmd2_app.complete_shell(text, line, begidx, endidx) == expected
+
def test_shell_command_completion_doesnt_match_wildcards(cmd2_app):
if sys.platform == "win32":
text = 'c*'
@@ -274,6 +287,18 @@ def test_path_completion_single_end(request):
assert path_complete(text, line, begidx, endidx) == ['conftest.py ']
+def test_path_completion_quotes(request):
+ test_dir = '"' + os.path.dirname(request.module.__file__)
+
+ text = 'c'
+ path = os.path.join(test_dir, text)
+ line = 'shell cat {}'.format(path)
+
+ endidx = len(line)
+ begidx = endidx - len(text)
+
+ assert path_complete(text, line, begidx, endidx) == ['conftest.py" ']
+
def test_path_completion_single_mid(request):
test_dir = os.path.dirname(request.module.__file__)