diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2002-12-07 19:57:25 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2002-12-07 19:57:25 +0000 |
commit | 7262b15ac8f8ffee07170747b9a94bf2bd7e09ff (patch) | |
tree | 677b0b8ffdef5360700decf12b3e38e8c4592426 /regress/lib/libc | |
parent | 7a3b4d4164802273d9084795afaff10285e223a5 (diff) |
Add test for fix in revision 1.5 of getopt_long.c
Diffstat (limited to 'regress/lib/libc')
-rw-r--r-- | regress/lib/libc/getopt_long/Makefile | 6 | ||||
-rw-r--r-- | regress/lib/libc/getopt_long/getopt_long_test.c | 1 | ||||
-rw-r--r-- | regress/lib/libc/getopt_long/test.ok | 20 |
3 files changed, 26 insertions, 1 deletions
diff --git a/regress/lib/libc/getopt_long/Makefile b/regress/lib/libc/getopt_long/Makefile index b5dd3435379..77292610792 100644 --- a/regress/lib/libc/getopt_long/Makefile +++ b/regress/lib/libc/getopt_long/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.2 2002/12/05 22:29:46 millert Exp $ +# $OpenBSD: Makefile,v 1.3 2002/12/07 19:57:24 millert Exp $ NOMAN= PROG=getopt_long_test @@ -9,18 +9,22 @@ run-regress-${PROG}: ${PROG} test -n "$$LONG_ONLY" && unset LONG_ONLY; \ ./${PROG} myfile --force -f infile -9 ; \ ./${PROG} onefile twofile --best -Williterate -i foo.in threefile ; \ + ./${PROG} -1bfast ; \ ./${PROG} --fast --drinking=guiness -i foo.in somefile ; \ export POSIXLY_CORRECT=1 ; \ ./${PROG} myfile --force -f infile -9 ; \ ./${PROG} onefile twofile --best -Williterate -i foo.in threefile ; \ + ./${PROG} -1bfast ; \ ./${PROG} --fast --drinking=guiness -i foo.in somefile ; \ unset POSIXLY_CORRECT ; export LONG_ONLY=1 ; \ ./${PROG} myfile -force -f infile -9 ; \ ./${PROG} onefile twofile -best -Williterate -i foo.in threefile ; \ + ./${PROG} -1bfast ; \ ./${PROG} --fast -drinking=guiness -i foo.in somefile ; \ export POSIXLY_CORRECT=1 ; \ ./${PROG} myfile -force -f infile -9 ; \ ./${PROG} onefile twofile -best -Williterate -i foo.in threefile ; \ + ./${PROG} -1bfast ; \ ./${PROG} --fast -drinking=guiness -i foo.in somefile ) >test.out 2>&1 cmp -s ${.OBJDIR}/test.out ${.CURDIR}/test.ok diff --git a/regress/lib/libc/getopt_long/getopt_long_test.c b/regress/lib/libc/getopt_long/getopt_long_test.c index acd25fb7495..b15613d9826 100644 --- a/regress/lib/libc/getopt_long/getopt_long_test.c +++ b/regress/lib/libc/getopt_long/getopt_long_test.c @@ -75,6 +75,7 @@ main(int argc, char **argv) case '1': case '9': case 'h': + case 'b': if (idx != -1) { if (goggles == 42) printf("option %s, arg %s\n", diff --git a/regress/lib/libc/getopt_long/test.ok b/regress/lib/libc/getopt_long/test.ok index 809577f2c83..124422f964d 100644 --- a/regress/lib/libc/getopt_long/test.ok +++ b/regress/lib/libc/getopt_long/test.ok @@ -10,6 +10,11 @@ option illiterate option i, arg foo.in remaining ARGV: onefile twofile threefile +getopt_long: -1bfast +option 1 +option b +option f, arg ast + getopt_long: --fast --drinking=guiness -i foo.in somefile option fast option drinking, arg guiness @@ -22,6 +27,11 @@ remaining ARGV: myfile --force -f infile -9 getopt_long (POSIXLY_CORRECT): onefile twofile --best -Williterate -i foo.in threefile remaining ARGV: onefile twofile --best -Williterate -i foo.in threefile +getopt_long (POSIXLY_CORRECT): -1bfast +option 1 +option b +option f, arg ast + getopt_long (POSIXLY_CORRECT): --fast --drinking=guiness -i foo.in somefile option fast option drinking, arg guiness @@ -40,6 +50,11 @@ option illiterate option i, arg foo.in remaining ARGV: onefile twofile threefile +getopt_long_only: -1bfast +option 1 +option b +option fast + getopt_long_only: --fast -drinking=guiness -i foo.in somefile option fast option drinking, arg guiness @@ -52,6 +67,11 @@ remaining ARGV: myfile -force -f infile -9 getopt_long_only (POSIXLY_CORRECT): onefile twofile -best -Williterate -i foo.in threefile remaining ARGV: onefile twofile -best -Williterate -i foo.in threefile +getopt_long_only (POSIXLY_CORRECT): -1bfast +option 1 +option b +option fast + getopt_long_only (POSIXLY_CORRECT): --fast -drinking=guiness -i foo.in somefile option fast option drinking, arg guiness |