2 test_description="argument parsing"
3 . $(dirname "$0")/test-lib.sh || exit 1
5 test_begin_subtest "sanity check"
6 $TEST_DIRECTORY/arg-test pos1 --keyword=one --boolean --string=foo pos2 --int=7 --flag=one --flag=three > OUTPUT
16 test_expect_equal_file EXPECTED OUTPUT
18 test_begin_subtest "sanity check zero values"
19 $TEST_DIRECTORY/arg-test --keyword=zero --boolean=false --int=0 > OUTPUT
25 test_expect_equal_file EXPECTED OUTPUT
27 test_begin_subtest "space instead of = between parameter name and value"
28 # Note: spaces aren't allowed for booleans. false turns into a positional arg!
29 $TEST_DIRECTORY/arg-test --keyword one --boolean false --string foo --int 7 --flag one --flag three > OUTPUT
36 positional arg 1 false
38 test_expect_equal_file EXPECTED OUTPUT