summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/regress/lib/libc/getopt_long/Makefile6
-rw-r--r--src/regress/lib/libc/getopt_long/getopt_long_test.c1
-rw-r--r--src/regress/lib/libc/getopt_long/test.ok20
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
3NOMAN= 3NOMAN=
4PROG=getopt_long_test 4PROG=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
10option i, arg foo.in 10option i, arg foo.in
11remaining ARGV: onefile twofile threefile 11remaining ARGV: onefile twofile threefile
12 12
13getopt_long: -1bfast
14option 1
15option b
16option f, arg ast
17
13getopt_long: --fast --drinking=guiness -i foo.in somefile 18getopt_long: --fast --drinking=guiness -i foo.in somefile
14option fast 19option fast
15option drinking, arg guiness 20option drinking, arg guiness
@@ -22,6 +27,11 @@ remaining ARGV: myfile --force -f infile -9
22getopt_long (POSIXLY_CORRECT): onefile twofile --best -Williterate -i foo.in threefile 27getopt_long (POSIXLY_CORRECT): onefile twofile --best -Williterate -i foo.in threefile
23remaining ARGV: onefile twofile --best -Williterate -i foo.in threefile 28remaining ARGV: onefile twofile --best -Williterate -i foo.in threefile
24 29
30getopt_long (POSIXLY_CORRECT): -1bfast
31option 1
32option b
33option f, arg ast
34
25getopt_long (POSIXLY_CORRECT): --fast --drinking=guiness -i foo.in somefile 35getopt_long (POSIXLY_CORRECT): --fast --drinking=guiness -i foo.in somefile
26option fast 36option fast
27option drinking, arg guiness 37option drinking, arg guiness
@@ -40,6 +50,11 @@ option illiterate
40option i, arg foo.in 50option i, arg foo.in
41remaining ARGV: onefile twofile threefile 51remaining ARGV: onefile twofile threefile
42 52
53getopt_long_only: -1bfast
54option 1
55option b
56option fast
57
43getopt_long_only: --fast -drinking=guiness -i foo.in somefile 58getopt_long_only: --fast -drinking=guiness -i foo.in somefile
44option fast 59option fast
45option drinking, arg guiness 60option drinking, arg guiness
@@ -52,6 +67,11 @@ remaining ARGV: myfile -force -f infile -9
52getopt_long_only (POSIXLY_CORRECT): onefile twofile -best -Williterate -i foo.in threefile 67getopt_long_only (POSIXLY_CORRECT): onefile twofile -best -Williterate -i foo.in threefile
53remaining ARGV: onefile twofile -best -Williterate -i foo.in threefile 68remaining ARGV: onefile twofile -best -Williterate -i foo.in threefile
54 69
70getopt_long_only (POSIXLY_CORRECT): -1bfast
71option 1
72option b
73option fast
74
55getopt_long_only (POSIXLY_CORRECT): --fast -drinking=guiness -i foo.in somefile 75getopt_long_only (POSIXLY_CORRECT): --fast -drinking=guiness -i foo.in somefile
56option fast 76option fast
57option drinking, arg guiness 77option drinking, arg guiness