diff options
author | jilles <jilles@FreeBSD.org> | 2014-05-07 21:45:25 +0000 |
---|---|---|
committer | jilles <jilles@FreeBSD.org> | 2014-05-07 21:45:25 +0000 |
commit | 3facf3e95417422a832c8620af1785e69c99487d (patch) | |
tree | 19f6fd0da8438502d2fa2b93624c7f5c64044fc5 /bin/sh/tests/builtins/getopts5.0 | |
parent | efb4e81e7402d0fe763fb4e1816712e7493bd763 (diff) | |
download | FreeBSD-src-3facf3e95417422a832c8620af1785e69c99487d.zip FreeBSD-src-3facf3e95417422a832c8620af1785e69c99487d.tar.gz |
sh: Add some tests for normal use of getopts.
Diffstat (limited to 'bin/sh/tests/builtins/getopts5.0')
-rw-r--r-- | bin/sh/tests/builtins/getopts5.0 | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/bin/sh/tests/builtins/getopts5.0 b/bin/sh/tests/builtins/getopts5.0 new file mode 100644 index 0000000..666ee76 --- /dev/null +++ b/bin/sh/tests/builtins/getopts5.0 @@ -0,0 +1,10 @@ +# $FreeBSD$ + +set -- -x arg +opt=not +getopts x opt +r1=$? OPTIND1=$OPTIND opt1=$opt +getopts x opt +r2=$? OPTIND2=$OPTIND +[ "$r1" = 0 ] && [ "$OPTIND1" = 2 ] && [ "$opt1" = x ] && [ "$r2" != 0 ] && + [ "$OPTIND2" = 2 ] |