diff options
| author | ruki <[email protected]> | 2021-01-12 00:29:12 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-01-12 00:29:12 +0800 |
| commit | bbb48dbc7ee40d510ff6a192417b1b4497d0ca95 (patch) | |
| tree | 9c735d063db1ef5c9d29b994bf20888a7beaa6de /tests/modules | |
| parent | e2b269b725607e0458cc337555e64c9c7fecde9f (diff) | |
fix os.args and split flags
Diffstat (limited to 'tests/modules')
| -rw-r--r-- | tests/modules/os/test.lua | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/modules/os/test.lua b/tests/modules/os/test.lua index e5e27456b..2b26cd939 100644 --- a/tests/modules/os/test.lua +++ b/tests/modules/os/test.lua @@ -91,6 +91,9 @@ function test_argv(t) t:are_equal(os.argv('"-DTEST=\\\"hello world\\\"" "-DTEST2=\\\"hello world2\\\""'), {'-DTEST="hello world"', '-DTEST2="hello world2"'}) -- $cli '-DTEST="hello world"' '-DTEST2="hello world2"' t:are_equal(os.argv("'-DTEST=\"hello world\"' '-DTEST2=\"hello world2\"'"), {'-DTEST="hello world"', '-DTEST2="hello world2"'}) + -- only split + t:are_equal(os.argv('-DTEST="hello world"', {splitonly = true}), {'-DTEST="hello world"'}) + t:are_equal(os.argv('-DTEST="hello world" -DTEST2="hello world2"', {splitonly = true}), {'-DTEST="hello world"', '-DTEST2="hello world2"'}) end function test_args(t) @@ -106,5 +109,5 @@ function test_args(t) t:are_equal(os.args('-DTEST="hello"'), '-DTEST=\\"hello\\"') t:are_equal(os.args({'-DTEST="hello"', '-DTEST2="hello"'}), '-DTEST=\\"hello\\" -DTEST2=\\"hello\\"') t:are_equal(os.args('-DTEST=hello'), '-DTEST=hello') -- irreversible --- t:are_equal(os.args({'-DTEST="hello world"', '-DTEST2="hello world2"'}), '"-DTEST=\\\"hello world\\\"" "-DTEST2=\\\"hello world2\\\""') + t:are_equal(os.args({'-DTEST="hello world"', '-DTEST2="hello world2"'}), '"-DTEST=\\\"hello world\\\"" "-DTEST2=\\\"hello world2\\\""') end |
