summaryrefslogtreecommitdiff
path: root/tests/test_parsing.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_parsing.py')
-rw-r--r--tests/test_parsing.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/test_parsing.py b/tests/test_parsing.py
index 9d92c876..de8d67af 100644
--- a/tests/test_parsing.py
+++ b/tests/test_parsing.py
@@ -394,6 +394,20 @@ def test_redirect_to_quoted_string(parser):
assert statement.output == '>'
assert statement.output_to == '"file.txt"'
+def test_redirect_to_single_quoted_string(parser):
+ line = "help alias > 'file.txt'"
+ statement = parser.parse(line)
+ assert statement.command == 'help'
+ assert statement == 'alias'
+ assert statement.args == statement
+ assert statement.argv == ['help', 'alias']
+ assert statement.arg_list == statement.argv[1:]
+ assert statement.terminator == ''
+ assert statement.suffix == ''
+ assert statement.pipe_to == ''
+ assert statement.output == '>'
+ assert statement.output_to == "'file.txt'"
+
def test_redirect_to_empty_quoted_string(parser):
line = 'help alias > ""'
statement = parser.parse(line)
@@ -408,6 +422,20 @@ def test_redirect_to_empty_quoted_string(parser):
assert statement.output == '>'
assert statement.output_to == ''
+def test_redirect_to_empty_single_quoted_string(parser):
+ line = "help alias > ''"
+ statement = parser.parse(line)
+ assert statement.command == 'help'
+ assert statement == 'alias'
+ assert statement.args == statement
+ assert statement.argv == ['help', 'alias']
+ assert statement.arg_list == statement.argv[1:]
+ assert statement.terminator == ''
+ assert statement.suffix == ''
+ assert statement.pipe_to == ''
+ assert statement.output == '>'
+ assert statement.output_to == ''
+
def test_parse_output_to_paste_buffer(parser):
line = 'output to paste buffer >> '
statement = parser.parse(line)