2011-12-07 19:37:13 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
test_description="argument parsing"
|
2015-08-06 11:13:36 +02:00
|
|
|
. ./test-lib.sh || exit 1
|
2011-12-07 19:37:13 +01:00
|
|
|
|
|
|
|
test_begin_subtest "sanity check"
|
2014-10-31 22:53:56 +01:00
|
|
|
$TEST_DIRECTORY/arg-test pos1 --keyword=one --string=foo pos2 --int=7 --flag=one --flag=three > OUTPUT
|
2011-12-07 19:37:13 +01:00
|
|
|
cat <<EOF > EXPECTED
|
|
|
|
keyword 1
|
2014-10-31 22:53:56 +01:00
|
|
|
flags 5
|
2011-12-07 19:37:13 +01:00
|
|
|
int 7
|
|
|
|
string foo
|
|
|
|
positional arg 1 pos1
|
2012-12-03 23:54:52 +01:00
|
|
|
positional arg 2 pos2
|
2011-12-07 19:37:13 +01:00
|
|
|
EOF
|
|
|
|
test_expect_equal_file OUTPUT EXPECTED
|
|
|
|
|
|
|
|
test_done
|