unittests: Add parse tests for ' quote.

setup.py
Pierre-Antoine Rouby 2023-10-27 15:10:16 +02:00
parent 3c738ebcb9
commit 7bbca7cf54
1 changed files with 9 additions and 0 deletions

View File

@ -140,6 +140,15 @@ class ToolsCMDParserTestCase(unittest.TestCase):
for i, s in enumerate(expect):
self.assertEqual(res[i], s)
def test_unix_quoted2_args_with_space(self):
cmd = "\'/foo/bar baz\' -a -b -c='baz bazz'"
expect = ["/foo/bar baz", "-a", '-b', "-c='baz bazz'"]
res = parse_command_line(cmd)
for i, s in enumerate(expect):
self.assertEqual(res[i], s)
def test_unix_escape_space(self):
cmd = r"/foo/bar\ baz -a -b -c"
expect = [r"/foo/bar\ baz", "-a", '-b', "-c"]