From 3c554067970b47e80b43d095ce798375decb876c Mon Sep 17 00:00:00 2001 From: mes5k Date: Fri, 21 Jan 2005 04:04:24 +0000 Subject: [PATCH] changes for xor bug --- tests/runtests.sh | 4 +++- tests/test20.out | 3 +++ tests/test20.sh | 2 +- tests/test21.out | 2 ++ tests/test21.sh | 2 +- tests/test22.out | 4 ++-- tests/test23.out | 4 ++-- tests/test24.out | 4 ++-- tests/test25.out | 3 +++ tests/test25.sh | 2 +- tests/test33.out | 3 +++ tests/test33.sh | 2 +- tests/test44.out | 11 +++++++++-- tests/test57.out | 11 +++++++++++ tests/test57.sh | 11 +++++++++++ 15 files changed, 55 insertions(+), 13 deletions(-) create mode 100644 tests/test57.out create mode 100755 tests/test57.sh diff --git a/tests/runtests.sh b/tests/runtests.sh index 4485786..845aa7f 100644 --- a/tests/runtests.sh +++ b/tests/runtests.sh @@ -6,9 +6,11 @@ let "fail = 0" for tnam in `ls test*.sh` do echo "Running test $tnam" - if ./$tnam && echo "OK" || echo "FAIL" ; then + if ./$tnam; then + echo "OK" let "suc = $(($suc + 1))" else + echo "FAIL" let "fail = $(($fail + 1))" fi done diff --git a/tests/test20.out b/tests/test20.out index fbd5cc1..1120da8 100644 --- a/tests/test20.out +++ b/tests/test20.out @@ -1,3 +1,6 @@ +for I: + 0 sss + 1 fdsf for A OR B we got : asdf for string C we got : fdas for string D we got : 0 diff --git a/tests/test20.sh b/tests/test20.sh index 36812d2..b094856 100755 --- a/tests/test20.sh +++ b/tests/test20.sh @@ -1,7 +1,7 @@ #!/bin/sh # success -../examples/test5 -a asdf -c fdas --eee blah > tmp.out 2>&1 +../examples/test5 -a asdf -c fdas --eee blah -i sss -i fdsf > tmp.out 2>&1 if cmp -s tmp.out test20.out; then exit 0 diff --git a/tests/test21.out b/tests/test21.out index 03bac4d..d9905f4 100644 --- a/tests/test21.out +++ b/tests/test21.out @@ -1,3 +1,5 @@ +for J: + 0 homer for A OR B we got : asdf for string C we got : fdas for string D we got : 0 diff --git a/tests/test21.sh b/tests/test21.sh index 7a3dd6b..ef58401 100755 --- a/tests/test21.sh +++ b/tests/test21.sh @@ -1,7 +1,7 @@ #!/bin/sh # success -../examples/test5 -b asdf -c fdas -g asdf > tmp.out 2>&1 +../examples/test5 -b asdf -c fdas -g asdf -j homer > tmp.out 2>&1 if cmp -s tmp.out test21.out; then exit 0 diff --git a/tests/test22.out b/tests/test22.out index c83f564..89e1910 100644 --- a/tests/test22.out +++ b/tests/test22.out @@ -3,8 +3,8 @@ PARSE ERROR: Argument: -b (--bbb) Brief USAGE: ../examples/test5 {-a |-b } {--eee |--fff - |-g } [--ddd] -c [--] [-v] - [-h] + |-g } {-i ... |-j + ... } [--ddd] -c [--] [-v] [-h] For complete USAGE and HELP type: ../examples/test5 --help diff --git a/tests/test23.out b/tests/test23.out index fc4c325..4b5059c 100644 --- a/tests/test23.out +++ b/tests/test23.out @@ -3,8 +3,8 @@ PARSE ERROR: Argument: -d Brief USAGE: ../examples/test5 {-a |-b } {--eee |--fff - |-g } [--ddd] -c [--] [-v] - [-h] + |-g } {-i ... |-j + ... } [--ddd] -c [--] [-v] [-h] For complete USAGE and HELP type: ../examples/test5 --help diff --git a/tests/test24.out b/tests/test24.out index c83f564..89e1910 100644 --- a/tests/test24.out +++ b/tests/test24.out @@ -3,8 +3,8 @@ PARSE ERROR: Argument: -b (--bbb) Brief USAGE: ../examples/test5 {-a |-b } {--eee |--fff - |-g } [--ddd] -c [--] [-v] - [-h] + |-g } {-i ... |-j + ... } [--ddd] -c [--] [-v] [-h] For complete USAGE and HELP type: ../examples/test5 --help diff --git a/tests/test25.out b/tests/test25.out index fbd5cc1..6ab8e92 100644 --- a/tests/test25.out +++ b/tests/test25.out @@ -1,3 +1,6 @@ +for I: + 0 one + 1 two for A OR B we got : asdf for string C we got : fdas for string D we got : 0 diff --git a/tests/test25.sh b/tests/test25.sh index 72039e1..9cf1cfd 100755 --- a/tests/test25.sh +++ b/tests/test25.sh @@ -1,7 +1,7 @@ #!/bin/sh # success -../examples/test5 --aaa asdf -c fdas --fff blah > tmp.out 2>&1 +../examples/test5 --aaa asdf -c fdas --fff blah -i one -i two > tmp.out 2>&1 if cmp -s tmp.out test25.out; then exit 0 diff --git a/tests/test33.out b/tests/test33.out index c882c77..733f05c 100644 --- a/tests/test33.out +++ b/tests/test33.out @@ -1,3 +1,6 @@ +for J: + 0 o + 1 t for A OR B we got : asdf for string C we got : fdas for string D we got : 1 diff --git a/tests/test33.sh b/tests/test33.sh index 98d1e1a..baaa6a4 100755 --- a/tests/test33.sh +++ b/tests/test33.sh @@ -1,7 +1,7 @@ #!/bin/sh # success -../examples/test5 -a asdf -c fdas --eee blah --ddd > tmp.out 2>&1 +../examples/test5 -a asdf -c fdas --eee blah --ddd -j o --jjj t > tmp.out 2>&1 if cmp -s tmp.out test33.out; then exit 0 diff --git a/tests/test44.out b/tests/test44.out index 27be3f3..19c0652 100644 --- a/tests/test44.out +++ b/tests/test44.out @@ -2,8 +2,8 @@ USAGE: ../examples/test5 {-a |-b } {--eee |--fff - |-g } [--ddd] -c [--] [-v] - [-h] + |-g } {-i ... |-j + ... } [--ddd] -c [--] [-v] [-h] Where: @@ -25,6 +25,13 @@ Where: (OR required) (value required) g test + -i , --iii (accepted multiple times) + (OR required) (value required) or test i + -- OR -- + -j , --jjj (accepted multiple times) + (OR required) (value required) or test j + + --ddd d test diff --git a/tests/test57.out b/tests/test57.out new file mode 100644 index 0000000..e84d8dc --- /dev/null +++ b/tests/test57.out @@ -0,0 +1,11 @@ +PARSE ERROR: + Too many arguments! + +Brief USAGE: + ../examples/test5 {-a |-b } {--eee |--fff + |-g } {-i ... |-j + ... } [--ddd] -c [--] [-v] [-h] + +For complete USAGE and HELP type: + ../examples/test5 --help + diff --git a/tests/test57.sh b/tests/test57.sh new file mode 100755 index 0000000..4dd1671 --- /dev/null +++ b/tests/test57.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +# failure +../examples/test5 --aaa asdf -c fdas --fff blah -i one -i two -j huh > tmp.out 2>&1 + +if cmp -s tmp.out test57.out; then + exit 0 +else + exit 1 +fi +