diff options
| author | millert <> | 2002-12-07 19:57:24 +0000 |
|---|---|---|
| committer | millert <> | 2002-12-07 19:57:24 +0000 |
| commit | d364cd2a62331a9116bb48fdbf5c81abc715df85 (patch) | |
| tree | 3710535217ca7deac2132bd5c56a9695b496065a | |
| parent | 7e5971005fab07ef2db960f8da4f61cae4f73db5 (diff) | |
| download | openbsd-d364cd2a62331a9116bb48fdbf5c81abc715df85.tar.gz openbsd-d364cd2a62331a9116bb48fdbf5c81abc715df85.tar.bz2 openbsd-d364cd2a62331a9116bb48fdbf5c81abc715df85.zip | |
Add test for fix in revision 1.5 of getopt_long.c
Diffstat (limited to '')
| -rw-r--r-- | src/regress/lib/libc/getopt_long/Makefile | 6 | ||||
| -rw-r--r-- | src/regress/lib/libc/getopt_long/getopt_long_test.c | 1 | ||||
| -rw-r--r-- | src/regress/lib/libc/getopt_long/test.ok | 20 |
3 files changed, 26 insertions, 1 deletions
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 @@ | |||
| 1 | # $OpenBSD: Makefile,v 1.2 2002/12/05 22:29:46 millert Exp $ | 1 | # $OpenBSD: Makefile,v 1.3 2002/12/07 19:57:24 millert Exp $ |
| 2 | 2 | ||
| 3 | NOMAN= | 3 | NOMAN= |
| 4 | PROG=getopt_long_test | 4 | PROG=getopt_long_test |
| @@ -9,18 +9,22 @@ run-regress-${PROG}: ${PROG} | |||
| 9 | test -n "$$LONG_ONLY" && unset LONG_ONLY; \ | 9 | test -n "$$LONG_ONLY" && unset LONG_ONLY; \ |
| 10 | ./${PROG} myfile --force -f infile -9 ; \ | 10 | ./${PROG} myfile --force -f infile -9 ; \ |
| 11 | ./${PROG} onefile twofile --best -Williterate -i foo.in threefile ; \ | 11 | ./${PROG} onefile twofile --best -Williterate -i foo.in threefile ; \ |
| 12 | ./${PROG} -1bfast ; \ | ||
| 12 | ./${PROG} --fast --drinking=guiness -i foo.in somefile ; \ | 13 | ./${PROG} --fast --drinking=guiness -i foo.in somefile ; \ |
| 13 | export POSIXLY_CORRECT=1 ; \ | 14 | export POSIXLY_CORRECT=1 ; \ |
| 14 | ./${PROG} myfile --force -f infile -9 ; \ | 15 | ./${PROG} myfile --force -f infile -9 ; \ |
| 15 | ./${PROG} onefile twofile --best -Williterate -i foo.in threefile ; \ | 16 | ./${PROG} onefile twofile --best -Williterate -i foo.in threefile ; \ |
| 17 | ./${PROG} -1bfast ; \ | ||
| 16 | ./${PROG} --fast --drinking=guiness -i foo.in somefile ; \ | 18 | ./${PROG} --fast --drinking=guiness -i foo.in somefile ; \ |
| 17 | unset POSIXLY_CORRECT ; export LONG_ONLY=1 ; \ | 19 | unset POSIXLY_CORRECT ; export LONG_ONLY=1 ; \ |
| 18 | ./${PROG} myfile -force -f infile -9 ; \ | 20 | ./${PROG} myfile -force -f infile -9 ; \ |
| 19 | ./${PROG} onefile twofile -best -Williterate -i foo.in threefile ; \ | 21 | ./${PROG} onefile twofile -best -Williterate -i foo.in threefile ; \ |
| 22 | ./${PROG} -1bfast ; \ | ||
| 20 | ./${PROG} --fast -drinking=guiness -i foo.in somefile ; \ | 23 | ./${PROG} --fast -drinking=guiness -i foo.in somefile ; \ |
| 21 | export POSIXLY_CORRECT=1 ; \ | 24 | export POSIXLY_CORRECT=1 ; \ |
| 22 | ./${PROG} myfile -force -f infile -9 ; \ | 25 | ./${PROG} myfile -force -f infile -9 ; \ |
| 23 | ./${PROG} onefile twofile -best -Williterate -i foo.in threefile ; \ | 26 | ./${PROG} onefile twofile -best -Williterate -i foo.in threefile ; \ |
| 27 | ./${PROG} -1bfast ; \ | ||
| 24 | ./${PROG} --fast -drinking=guiness -i foo.in somefile ) >test.out 2>&1 | 28 | ./${PROG} --fast -drinking=guiness -i foo.in somefile ) >test.out 2>&1 |
| 25 | cmp -s ${.OBJDIR}/test.out ${.CURDIR}/test.ok | 29 | cmp -s ${.OBJDIR}/test.out ${.CURDIR}/test.ok |
| 26 | 30 | ||
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) | |||
| 75 | case '1': | 75 | case '1': |
| 76 | case '9': | 76 | case '9': |
| 77 | case 'h': | 77 | case 'h': |
| 78 | case 'b': | ||
| 78 | if (idx != -1) { | 79 | if (idx != -1) { |
| 79 | if (goggles == 42) | 80 | if (goggles == 42) |
| 80 | printf("option %s, arg %s\n", | 81 | 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 | |||
| 10 | option i, arg foo.in | 10 | option i, arg foo.in |
| 11 | remaining ARGV: onefile twofile threefile | 11 | remaining ARGV: onefile twofile threefile |
| 12 | 12 | ||
| 13 | getopt_long: -1bfast | ||
| 14 | option 1 | ||
| 15 | option b | ||
| 16 | option f, arg ast | ||
| 17 | |||
| 13 | getopt_long: --fast --drinking=guiness -i foo.in somefile | 18 | getopt_long: --fast --drinking=guiness -i foo.in somefile |
| 14 | option fast | 19 | option fast |
| 15 | option drinking, arg guiness | 20 | option drinking, arg guiness |
| @@ -22,6 +27,11 @@ remaining ARGV: myfile --force -f infile -9 | |||
| 22 | getopt_long (POSIXLY_CORRECT): onefile twofile --best -Williterate -i foo.in threefile | 27 | getopt_long (POSIXLY_CORRECT): onefile twofile --best -Williterate -i foo.in threefile |
| 23 | remaining ARGV: onefile twofile --best -Williterate -i foo.in threefile | 28 | remaining ARGV: onefile twofile --best -Williterate -i foo.in threefile |
| 24 | 29 | ||
| 30 | getopt_long (POSIXLY_CORRECT): -1bfast | ||
| 31 | option 1 | ||
| 32 | option b | ||
| 33 | option f, arg ast | ||
| 34 | |||
| 25 | getopt_long (POSIXLY_CORRECT): --fast --drinking=guiness -i foo.in somefile | 35 | getopt_long (POSIXLY_CORRECT): --fast --drinking=guiness -i foo.in somefile |
| 26 | option fast | 36 | option fast |
| 27 | option drinking, arg guiness | 37 | option drinking, arg guiness |
| @@ -40,6 +50,11 @@ option illiterate | |||
| 40 | option i, arg foo.in | 50 | option i, arg foo.in |
| 41 | remaining ARGV: onefile twofile threefile | 51 | remaining ARGV: onefile twofile threefile |
| 42 | 52 | ||
| 53 | getopt_long_only: -1bfast | ||
| 54 | option 1 | ||
| 55 | option b | ||
| 56 | option fast | ||
| 57 | |||
| 43 | getopt_long_only: --fast -drinking=guiness -i foo.in somefile | 58 | getopt_long_only: --fast -drinking=guiness -i foo.in somefile |
| 44 | option fast | 59 | option fast |
| 45 | option drinking, arg guiness | 60 | option drinking, arg guiness |
| @@ -52,6 +67,11 @@ remaining ARGV: myfile -force -f infile -9 | |||
| 52 | getopt_long_only (POSIXLY_CORRECT): onefile twofile -best -Williterate -i foo.in threefile | 67 | getopt_long_only (POSIXLY_CORRECT): onefile twofile -best -Williterate -i foo.in threefile |
| 53 | remaining ARGV: onefile twofile -best -Williterate -i foo.in threefile | 68 | remaining ARGV: onefile twofile -best -Williterate -i foo.in threefile |
| 54 | 69 | ||
| 70 | getopt_long_only (POSIXLY_CORRECT): -1bfast | ||
| 71 | option 1 | ||
| 72 | option b | ||
| 73 | option fast | ||
| 74 | |||
| 55 | getopt_long_only (POSIXLY_CORRECT): --fast -drinking=guiness -i foo.in somefile | 75 | getopt_long_only (POSIXLY_CORRECT): --fast -drinking=guiness -i foo.in somefile |
| 56 | option fast | 76 | option fast |
| 57 | option drinking, arg guiness | 77 | option drinking, arg guiness |
