diff --git a/tests/Makefile.am b/tests/Makefile.am index 61e2820..7867176 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -53,7 +53,9 @@ TESTS = test1.sh \ test51.sh \ test52.sh \ test53.sh \ - test54.sh + test54.sh \ + test55.sh \ + test56.sh EXTRA_DIST = $(TESTS) \ test1.out \ @@ -109,5 +111,7 @@ EXTRA_DIST = $(TESTS) \ test51.out \ test52.out \ test53.out \ - test54.out + test54.out \ + test55.out \ + test56.out diff --git a/tests/test13.sh b/tests/test13.sh index ed4fc92..fd7f81f 100755 --- a/tests/test13.sh +++ b/tests/test13.sh @@ -1,7 +1,7 @@ #!/bin/sh # success -../examples/test3 -s=bill -i=9 -i=8 -B homer marge bart > tmp.out 2>&1 +../examples/test3 --stringTest=bill -i=9 -i=8 -B homer marge bart > tmp.out 2>&1 if cmp -s tmp.out test13.out; then exit 0 diff --git a/tests/test14.sh b/tests/test14.sh index f26d43b..2ecce12 100755 --- a/tests/test14.sh +++ b/tests/test14.sh @@ -1,7 +1,7 @@ #!/bin/sh # success -../examples/test3 -s=aaa homer marge bart -- one two > tmp.out 2>&1 +../examples/test3 --stringTest=aaa homer marge bart -- one two > tmp.out 2>&1 if cmp -s tmp.out test14.out; then exit 0 diff --git a/tests/test15.out b/tests/test15.out index 6742abd..ad4e3f9 100644 --- a/tests/test15.out +++ b/tests/test15.out @@ -1,10 +1,10 @@ -PARSE ERROR: Argument: -s (--stringTest) +PARSE ERROR: Argument: (--stringTest) Couldn't find delimiter for this argument! Brief USAGE: - ../examples/test3 [-f=] ... [-i=] ... -s= [-B] - [--] [-v] [-h] - ... + ../examples/test3 [-f=] ... [-i=] ... + --stringTest= [-B] [--] [-v] [-h] + ... For complete USAGE and HELP type: ../examples/test3 --help diff --git a/tests/test15.sh b/tests/test15.sh index 6719da4..d70a1a7 100755 --- a/tests/test15.sh +++ b/tests/test15.sh @@ -1,7 +1,7 @@ #!/bin/sh # failure -../examples/test3 -s bbb homer marge bart -- -hv two > tmp.out 2>&1 +../examples/test3 --stringTest bbb homer marge bart -- -hv two > tmp.out 2>&1 if cmp -s tmp.out test15.out; then exit 0 diff --git a/tests/test16.out b/tests/test16.out index 6742abd..ad4e3f9 100644 --- a/tests/test16.out +++ b/tests/test16.out @@ -1,10 +1,10 @@ -PARSE ERROR: Argument: -s (--stringTest) +PARSE ERROR: Argument: (--stringTest) Couldn't find delimiter for this argument! Brief USAGE: - ../examples/test3 [-f=] ... [-i=] ... -s= [-B] - [--] [-v] [-h] - ... + ../examples/test3 [-f=] ... [-i=] ... + --stringTest= [-B] [--] [-v] [-h] + ... For complete USAGE and HELP type: ../examples/test3 --help diff --git a/tests/test16.sh b/tests/test16.sh index 4e9ab4b..ba1e69f 100755 --- a/tests/test16.sh +++ b/tests/test16.sh @@ -1,7 +1,7 @@ #!/bin/sh # failure -../examples/test3 -s one homer -B -Bh > tmp.out 2>&1 +../examples/test3 --stringTest one homer -B -Bh > tmp.out 2>&1 if cmp -s tmp.out test16.out; then exit 0 diff --git a/tests/test17.out b/tests/test17.out index 135ec94..c5d482c 100644 --- a/tests/test17.out +++ b/tests/test17.out @@ -2,9 +2,9 @@ PARSE ERROR: One or more required arguments missing! Brief USAGE: - ../examples/test3 [-f=] ... [-i=] ... -s= [-B] - [--] [-v] [-h] - ... + ../examples/test3 [-f=] ... [-i=] ... + --stringTest= [-B] [--] [-v] [-h] + ... For complete USAGE and HELP type: ../examples/test3 --help diff --git a/tests/test17.sh b/tests/test17.sh index 5cb6224..754974c 100755 --- a/tests/test17.sh +++ b/tests/test17.sh @@ -1,7 +1,7 @@ #!/bin/sh # failure -../examples/test3 -s=one homer -B > tmp.out 2>&1 +../examples/test3 --stringTest=one homer -B > tmp.out 2>&1 if cmp -s tmp.out test17.out; then exit 0 diff --git a/tests/test31.out b/tests/test31.out index 4d2c15b..69460c8 100644 --- a/tests/test31.out +++ b/tests/test31.out @@ -2,9 +2,9 @@ PARSE ERROR: Argument: -i (--intTest) Couldn't read argument value from string '9a' Brief USAGE: - ../examples/test3 [-f=] ... [-i=] ... -s= [-B] - [--] [-v] [-h] - ... + ../examples/test3 [-f=] ... [-i=] ... + --stringTest= [-B] [--] [-v] [-h] + ... For complete USAGE and HELP type: ../examples/test3 --help diff --git a/tests/test32.out b/tests/test32.out index 98d984f..dc586a4 100644 --- a/tests/test32.out +++ b/tests/test32.out @@ -2,9 +2,9 @@ PARSE ERROR: Argument: -f (--floatTest) More than one valid value parsed from string '1.0.0' Brief USAGE: - ../examples/test3 [-f=] ... [-i=] ... -s= [-B] - [--] [-v] [-h] - ... + ../examples/test3 [-f=] ... [-i=] ... + --stringTest= [-B] [--] [-v] [-h] + ... For complete USAGE and HELP type: ../examples/test3 --help diff --git a/tests/test42.out b/tests/test42.out index e3914f8..4b4d33b 100644 --- a/tests/test42.out +++ b/tests/test42.out @@ -1,9 +1,9 @@ USAGE: - ../examples/test3 [-f=] ... [-i=] ... -s= [-B] - [--] [-v] [-h] - ... + ../examples/test3 [-f=] ... [-i=] ... + --stringTest= [-B] [--] [-v] [-h] + ... Where: @@ -14,7 +14,7 @@ Where: -i , --intTest (accepted multiple times) (value required) multi int test - -s , --stringTest + --stringTest (required) (value required) string test -B, --existTestB diff --git a/tests/test55.out b/tests/test55.out new file mode 100644 index 0000000..3105e3d --- /dev/null +++ b/tests/test55.out @@ -0,0 +1,6 @@ +[ ] 0 zero +[ ] 1 one +for string we got : asdf +for ulabeled one we got : - +for ulabeled two we got : asdf +for bool B we got : 0 diff --git a/tests/test55.sh b/tests/test55.sh new file mode 100755 index 0000000..09140f9 --- /dev/null +++ b/tests/test55.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +# success +../examples/test3 --stringTest=asdf - asdf zero one > tmp.out 2>&1 + +if cmp -s tmp.out test55.out; then + exit 0 +else + exit 1 +fi + diff --git a/tests/test56.out b/tests/test56.out new file mode 100644 index 0000000..f77f3ba --- /dev/null +++ b/tests/test56.out @@ -0,0 +1,9 @@ +0 one +1 two +for float we got : 3.7 +for int we got : 1 +for string we got : fdsa +for ulabeled we got : - +for bool A we got : 0 +for bool B we got : 0 +for bool C we got : 0 diff --git a/tests/test56.sh b/tests/test56.sh new file mode 100755 index 0000000..2bf6ae9 --- /dev/null +++ b/tests/test56.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +# success +../examples/test2 -i 1 - -s fdsa one two > tmp.out 2>&1 + +if cmp -s tmp.out test56.out; then + exit 0 +else + exit 1 +fi +