diff --git a/tests/Makefile.am b/tests/Makefile.am index 592090c..17789b0 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -31,7 +31,8 @@ TESTS = test1.sh \ test29.sh \ test30.sh \ test31.sh \ - test32.sh + test32.sh \ + test33.sh EXTRA_DIST = $(TESTS) \ test1.out \ @@ -65,5 +66,6 @@ EXTRA_DIST = $(TESTS) \ test29.out \ test30.out \ test31.out \ - test32.out + test32.out \ + test33.out diff --git a/tests/test20.out b/tests/test20.out index 1958b51..c882c77 100644 --- a/tests/test20.out +++ b/tests/test20.out @@ -1,4 +1,4 @@ for A OR B we got : asdf for string C we got : fdas -for string D we got : homer +for string D we got : 1 for E or F or G we got: blah diff --git a/tests/test21.out b/tests/test21.out index bed3f46..94995a0 100644 --- a/tests/test21.out +++ b/tests/test21.out @@ -1,4 +1,4 @@ for A OR B we got : asdf for string C we got : fdas -for string D we got : homer +for string D we got : 1 for E or F or G we got: asdf diff --git a/tests/test22.out b/tests/test22.out index 3947557..5906ee5 100644 --- a/tests/test22.out +++ b/tests/test22.out @@ -4,7 +4,7 @@ PARSE ERROR: Argument: -b (--bbb) USAGE: - ../examples/test5 {-a |-b } {--eee |--fff |-g } [-d ] -c [--] [-v] [-h] + ../examples/test5 {-a |-b } {--eee |--fff |-g } -c [--] [-v] [-h] [--ddd] Where: @@ -25,9 +25,6 @@ Where: (OR required) (value required) g test - -d , --ddd - (value required) d test - -c , --ccc (required) (value required) c test @@ -40,6 +37,9 @@ Where: -h, --help Displays usage information and exits. + --ddd + d test + this is a message diff --git a/tests/test23.out b/tests/test23.out index 46cbf99..23517f1 100644 --- a/tests/test23.out +++ b/tests/test23.out @@ -1,10 +1,10 @@ -PARSE ERROR: - One or more required arguments missing! +PARSE ERROR: Argument: -d + Couldn't find match for argument USAGE: - ../examples/test5 {-a |-b } {--eee |--fff |-g } [-d ] -c [--] [-v] [-h] + ../examples/test5 {-a |-b } {--eee |--fff |-g } -c [--] [-v] [-h] [--ddd] Where: @@ -25,9 +25,6 @@ Where: (OR required) (value required) g test - -d , --ddd - (value required) d test - -c , --ccc (required) (value required) c test @@ -40,6 +37,9 @@ Where: -h, --help Displays usage information and exits. + --ddd + d test + this is a message diff --git a/tests/test24.out b/tests/test24.out index 3947557..5906ee5 100644 --- a/tests/test24.out +++ b/tests/test24.out @@ -4,7 +4,7 @@ PARSE ERROR: Argument: -b (--bbb) USAGE: - ../examples/test5 {-a |-b } {--eee |--fff |-g } [-d ] -c [--] [-v] [-h] + ../examples/test5 {-a |-b } {--eee |--fff |-g } -c [--] [-v] [-h] [--ddd] Where: @@ -25,9 +25,6 @@ Where: (OR required) (value required) g test - -d , --ddd - (value required) d test - -c , --ccc (required) (value required) c test @@ -40,6 +37,9 @@ Where: -h, --help Displays usage information and exits. + --ddd + d test + this is a message diff --git a/tests/test25.out b/tests/test25.out index 1958b51..c882c77 100644 --- a/tests/test25.out +++ b/tests/test25.out @@ -1,4 +1,4 @@ for A OR B we got : asdf for string C we got : fdas -for string D we got : homer +for string D we got : 1 for E or F or G we got: blah diff --git a/tests/test33.out b/tests/test33.out new file mode 100644 index 0000000..fbd5cc1 --- /dev/null +++ b/tests/test33.out @@ -0,0 +1,4 @@ +for A OR B we got : asdf +for string C we got : fdas +for string D we got : 0 +for E or F or G we got: blah diff --git a/tests/test33.sh b/tests/test33.sh new file mode 100755 index 0000000..98d1e1a --- /dev/null +++ b/tests/test33.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +# success +../examples/test5 -a asdf -c fdas --eee blah --ddd > tmp.out 2>&1 + +if cmp -s tmp.out test33.out; then + exit 0 +else + exit 1 +fi +