diff --git a/tests/Makefile.am b/tests/Makefile.am index 7bc5c1f..592090c 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -24,7 +24,14 @@ TESTS = test1.sh \ test22.sh \ test23.sh \ test24.sh \ - test25.sh + test25.sh \ + test26.sh \ + test27.sh \ + test28.sh \ + test29.sh \ + test30.sh \ + test31.sh \ + test32.sh EXTRA_DIST = $(TESTS) \ test1.out \ @@ -51,5 +58,12 @@ EXTRA_DIST = $(TESTS) \ test22.out \ test23.out \ test24.out \ - test25.out + test25.out \ + test26.out \ + test27.out \ + test28.out \ + test29.out \ + test30.out \ + test31.out \ + test32.out diff --git a/tests/test26.out b/tests/test26.out new file mode 100644 index 0000000..ad76e26 --- /dev/null +++ b/tests/test26.out @@ -0,0 +1,47 @@ +PARSE ERROR: Argument: -f (--floatTest) + More than one valid value parsed from string '4..2' + + +USAGE: + + ../examples/test2 [-f ] -i -s [-A] [-C] [-B] [--] [-v] [-h] ... + +Where: + + -f , --floatTest + (value required) float test + + -i , --intTest + (required) (value required) integer test + + -s , --stringTest + (required) (value required) string test + + -A, --existTestA + tests for the existence of A + + -C, --existTestC + tests for the existence of C + + -B, --existTestB + tests for the existence of B + + --, --ignore_rest + Ignores the rest of the labeled arguments following this flag. + + -v, --version + Displays version information and exits. + + -h, --help + Displays usage information and exits. + + + (required) (value required) unlabeld test + + (accepted multiple times) + (value required) file names + + + +this is a message + diff --git a/tests/test26.sh b/tests/test26.sh new file mode 100755 index 0000000..2faf659 --- /dev/null +++ b/tests/test26.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +# failure +../examples/test2 -i 2 -f 4..2 -s asdf asdf > tmp.out 2>&1 + +if cmp -s tmp.out test26.out; then + exit 0 +else + exit 1 +fi + diff --git a/tests/test27.out b/tests/test27.out new file mode 100644 index 0000000..018531e --- /dev/null +++ b/tests/test27.out @@ -0,0 +1,47 @@ +PARSE ERROR: Argument: -f (--floatTest) + More than one valid value parsed from string '4.0.2' + + +USAGE: + + ../examples/test2 [-f ] -i -s [-A] [-C] [-B] [--] [-v] [-h] ... + +Where: + + -f , --floatTest + (value required) float test + + -i , --intTest + (required) (value required) integer test + + -s , --stringTest + (required) (value required) string test + + -A, --existTestA + tests for the existence of A + + -C, --existTestC + tests for the existence of C + + -B, --existTestB + tests for the existence of B + + --, --ignore_rest + Ignores the rest of the labeled arguments following this flag. + + -v, --version + Displays version information and exits. + + -h, --help + Displays usage information and exits. + + + (required) (value required) unlabeld test + + (accepted multiple times) + (value required) file names + + + +this is a message + diff --git a/tests/test27.sh b/tests/test27.sh new file mode 100755 index 0000000..05fe89e --- /dev/null +++ b/tests/test27.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +# failure +../examples/test2 -i 2 -f 4.0.2 -s asdf asdf > tmp.out 2>&1 + +if cmp -s tmp.out test27.out; then + exit 0 +else + exit 1 +fi + diff --git a/tests/test28.out b/tests/test28.out new file mode 100644 index 0000000..6a9e5bd --- /dev/null +++ b/tests/test28.out @@ -0,0 +1,47 @@ +PARSE ERROR: Argument: -i (--intTest) + Couldn't read argument value from string '2a' + + +USAGE: + + ../examples/test2 [-f ] -i -s [-A] [-C] [-B] [--] [-v] [-h] ... + +Where: + + -f , --floatTest + (value required) float test + + -i , --intTest + (required) (value required) integer test + + -s , --stringTest + (required) (value required) string test + + -A, --existTestA + tests for the existence of A + + -C, --existTestC + tests for the existence of C + + -B, --existTestB + tests for the existence of B + + --, --ignore_rest + Ignores the rest of the labeled arguments following this flag. + + -v, --version + Displays version information and exits. + + -h, --help + Displays usage information and exits. + + + (required) (value required) unlabeld test + + (accepted multiple times) + (value required) file names + + + +this is a message + diff --git a/tests/test28.sh b/tests/test28.sh new file mode 100755 index 0000000..bb27f5c --- /dev/null +++ b/tests/test28.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +# failure +../examples/test2 -i 2a -f 4.2 -s asdf asdf > tmp.out 2>&1 + +if cmp -s tmp.out test28.out; then + exit 0 +else + exit 1 +fi + diff --git a/tests/test29.out b/tests/test29.out new file mode 100644 index 0000000..80a9ac4 --- /dev/null +++ b/tests/test29.out @@ -0,0 +1,47 @@ +PARSE ERROR: Argument: -i (--intTest) + Couldn't read argument value from string '0x2' + + +USAGE: + + ../examples/test2 [-f ] -i -s [-A] [-C] [-B] [--] [-v] [-h] ... + +Where: + + -f , --floatTest + (value required) float test + + -i , --intTest + (required) (value required) integer test + + -s , --stringTest + (required) (value required) string test + + -A, --existTestA + tests for the existence of A + + -C, --existTestC + tests for the existence of C + + -B, --existTestB + tests for the existence of B + + --, --ignore_rest + Ignores the rest of the labeled arguments following this flag. + + -v, --version + Displays version information and exits. + + -h, --help + Displays usage information and exits. + + + (required) (value required) unlabeld test + + (accepted multiple times) + (value required) file names + + + +this is a message + diff --git a/tests/test29.sh b/tests/test29.sh new file mode 100755 index 0000000..a2a1c93 --- /dev/null +++ b/tests/test29.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +# failure ! ack no hex :( +../examples/test2 -i 0x2 -f 4.2 -s asdf asdf > tmp.out 2>&1 + +if cmp -s tmp.out test29.out; then + exit 0 +else + exit 1 +fi + diff --git a/tests/test30.out b/tests/test30.out new file mode 100644 index 0000000..3754267 --- /dev/null +++ b/tests/test30.out @@ -0,0 +1,47 @@ +PARSE ERROR: Argument: -i (--intTest) + Couldn't read argument value from string '2.1' + + +USAGE: + + ../examples/test2 [-f ] -i -s [-A] [-C] [-B] [--] [-v] [-h] ... + +Where: + + -f , --floatTest + (value required) float test + + -i , --intTest + (required) (value required) integer test + + -s , --stringTest + (required) (value required) string test + + -A, --existTestA + tests for the existence of A + + -C, --existTestC + tests for the existence of C + + -B, --existTestB + tests for the existence of B + + --, --ignore_rest + Ignores the rest of the labeled arguments following this flag. + + -v, --version + Displays version information and exits. + + -h, --help + Displays usage information and exits. + + + (required) (value required) unlabeld test + + (accepted multiple times) + (value required) file names + + + +this is a message + diff --git a/tests/test30.sh b/tests/test30.sh new file mode 100755 index 0000000..04b6a3c --- /dev/null +++ b/tests/test30.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +# failure +../examples/test2 -i 2.1 -f 4.2 -s asdf asdf > tmp.out 2>&1 + +if cmp -s tmp.out test30.out; then + exit 0 +else + exit 1 +fi + diff --git a/tests/test31.out b/tests/test31.out new file mode 100644 index 0000000..8f45363 --- /dev/null +++ b/tests/test31.out @@ -0,0 +1,44 @@ +PARSE ERROR: Argument: -i (--intTest) + Couldn't read argument value from string '9a' + + +USAGE: + + ../examples/test3 [-f=] ... [-i=] ... -s= [-B] [--] [-v] [-h] ... + +Where: + + -f , --floatTest (accepted multiple times) + (value required) multi float test + + -i , --intTest (accepted multiple times) + (value required) multi int test + + -s , --stringTest + (required) (value required) string test + + -B, --existTest B + exist Test B + + --, --ignore_rest + Ignores the rest of the labeled arguments following this flag. + + -v, --version + Displays version information and exits. + + -h, --help + Displays usage information and exits. + + + (required) (value required) unlabeled test one + + + (required) (value required) unlabeled test two + + (accepted multiple times) + (value required) file names + + + +this is a message + diff --git a/tests/test31.sh b/tests/test31.sh new file mode 100755 index 0000000..8243f11 --- /dev/null +++ b/tests/test31.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +# failure +../examples/test3 -i=9a -i=1 -s=asdf asdf asdf > tmp.out 2>&1 + +if cmp -s tmp.out test31.out; then + exit 0 +else + exit 1 +fi + diff --git a/tests/test32.out b/tests/test32.out new file mode 100644 index 0000000..e966b8e --- /dev/null +++ b/tests/test32.out @@ -0,0 +1,44 @@ +PARSE ERROR: Argument: -f (--floatTest) + More than one valid value parsed from string '1.0.0' + + +USAGE: + + ../examples/test3 [-f=] ... [-i=] ... -s= [-B] [--] [-v] [-h] ... + +Where: + + -f , --floatTest (accepted multiple times) + (value required) multi float test + + -i , --intTest (accepted multiple times) + (value required) multi int test + + -s , --stringTest + (required) (value required) string test + + -B, --existTest B + exist Test B + + --, --ignore_rest + Ignores the rest of the labeled arguments following this flag. + + -v, --version + Displays version information and exits. + + -h, --help + Displays usage information and exits. + + + (required) (value required) unlabeled test one + + + (required) (value required) unlabeled test two + + (accepted multiple times) + (value required) file names + + + +this is a message + diff --git a/tests/test32.sh b/tests/test32.sh new file mode 100755 index 0000000..0a77a61 --- /dev/null +++ b/tests/test32.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +# failure +../examples/test3 -f=9 -f=1.0.0 -s=asdf asdf asdf > tmp.out 2>&1 + +if cmp -s tmp.out test32.out; then + exit 0 +else + exit 1 +fi +