From d364cd2a62331a9116bb48fdbf5c81abc715df85 Mon Sep 17 00:00:00 2001 From: millert <> Date: Sat, 7 Dec 2002 19:57:24 +0000 Subject: Add test for fix in revision 1.5 of getopt_long.c --- src/regress/lib/libc/getopt_long/Makefile | 6 +++++- src/regress/lib/libc/getopt_long/getopt_long_test.c | 1 + src/regress/lib/libc/getopt_long/test.ok | 20 ++++++++++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/regress/lib/libc/getopt_long/Makefile b/src/regress/lib/libc/getopt_long/Makefile index b5dd343537..7729261079 100644 --- a/src/regress/lib/libc/getopt_long/Makefile +++ b/src/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/src/regress/lib/libc/getopt_long/getopt_long_test.c b/src/regress/lib/libc/getopt_long/getopt_long_test.c index acd25fb749..b15613d982 100644 --- a/src/regress/lib/libc/getopt_long/getopt_long_test.c +++ b/src/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/src/regress/lib/libc/getopt_long/test.ok b/src/regress/lib/libc/getopt_long/test.ok index 809577f2c8..124422f964 100644 --- a/src/regress/lib/libc/getopt_long/test.ok +++ b/src/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 -- cgit v1.2.3-55-g6feb