summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/support/lua-alt-getopt/tests/test.sh
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-02-27 17:31:54 +0000
committerKarl Berry <karl@freefriends.org>2010-02-27 17:31:54 +0000
commitcad9c7b7552dabd8248a903fa699d4764cb05723 (patch)
treee3cdc5411e8ffef074304e6e6df84ccf6d90311f /Master/texmf-dist/doc/support/lua-alt-getopt/tests/test.sh
parentf156b9f9622bbc52d6d48f41cc9e7910cdcd8039 (diff)
new package lua-alt-getopt 0.7.0 (26feb10)
git-svn-id: svn://tug.org/texlive/trunk@17228 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/support/lua-alt-getopt/tests/test.sh')
-rw-r--r--Master/texmf-dist/doc/support/lua-alt-getopt/tests/test.sh48
1 files changed, 48 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/support/lua-alt-getopt/tests/test.sh b/Master/texmf-dist/doc/support/lua-alt-getopt/tests/test.sh
new file mode 100644
index 00000000000..8487a8e7e45
--- /dev/null
+++ b/Master/texmf-dist/doc/support/lua-alt-getopt/tests/test.sh
@@ -0,0 +1,48 @@
+#!/bin/sh
+
+runtest (){
+ printf '=================================================================\n'
+ printf '======= args: %s\n' "$*"
+ "$@" 2>&1 | awk '/stack traceback:/, /\[C\]: [?]/ {next} {print}'
+}
+
+do_test_getopt (){
+ runtest ../alt_getopt -h -
+ runtest ../alt_getopt --help
+ runtest ../alt_getopt -h --help -v --verbose -V -o 123 -o234
+ runtest ../alt_getopt --output 123 --output 234 -n 999 -n9999 --len 5 --fake /dev/null
+ runtest ../alt_getopt -hVv -- -1 -2 -3
+ runtest ../alt_getopt --fake -v -- -1 -2 -3
+ runtest ../alt_getopt - -1 -2 -3
+ runtest ../alt_getopt --fake -v - -1 -2 -3
+ runtest ../alt_getopt -1 -2 -3
+ runtest ../alt_getopt -hvV
+ runtest ../alt_getopt -ho 123
+ runtest ../alt_getopt -hoV 123
+ runtest ../alt_getopt --unknown
+ runtest ../alt_getopt --output='file.out' -nNNN --len=LENGTH
+ runtest ../alt_getopt --output --file--
+
+ runtest ../alt_getopt --output
+ runtest ../alt_getopt -ho
+ runtest ../alt_getopt --help -o
+ runtest ../alt_getopt --help=value
+ runtest ../alt_getopt -ofile1 --set_value 111 --output file2 \
+ --set-output=file3
+
+ true
+}
+
+do_test (){
+ do_test_getopt
+}
+
+OBJDIR=${OBJDIR:=.}
+
+do_test > $OBJDIR/_test.res 2>&1
+
+if ! diff -u test.out $OBJDIR/_test.res; then
+ echo "rewrite fails" 1>&2
+ exit 1
+fi
+