From 61d95b7cb39551b2ca002c0fd2285c68a02a18a1 Mon Sep 17 00:00:00 2001 From: Kevin Van Brunt Date: Sun, 17 Mar 2019 00:06:16 -0400 Subject: Added unit tests for expand flag of parse() --- tests/test_parsing.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests/test_parsing.py') diff --git a/tests/test_parsing.py b/tests/test_parsing.py index 85ee0765..8cea3305 100644 --- a/tests/test_parsing.py +++ b/tests/test_parsing.py @@ -471,11 +471,18 @@ def test_empty_statement_raises_exception(): ('l', 'shell', 'ls -al') ]) def test_parse_alias_and_shortcut_expansion(parser, line, command, args): + # Test first with expansion statement = parser.parse(line) assert statement.command == command assert statement == args assert statement.args == statement + # Now allow no expansion + statement = parser.parse(line, expand=False) + assert statement.command == line.split()[0] + assert statement.split() == line.split()[1:] + assert statement.args == statement + def test_parse_alias_on_multiline_command(parser): line = 'anothermultiline has > inside an unfinished command' statement = parser.parse(line) -- cgit v1.2.1