]> diplodocus.org Git - nmh/blob - test/format/test-ap
Work around flex 2.6.3 bug by conditionally #undef yywrap.
[nmh] / test / format / test-ap
1 #!/bin/sh
2
3 # Tests for ap(8)'s coverage.
4
5 if test -z "${MH_OBJ_DIR}"; then
6 srcdir=`dirname "$0"`/../..
7 MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR
8 fi
9
10 . "$MH_OBJ_DIR/test/common.sh"
11
12 setup_test
13
14 # Use proper program, likely not the first one on PATH.
15 ap="${MH_LIBEXEC_DIR}/ap"
16
17 check_exit '-eq 1' $ap -
18 check_exit '-eq 1' $ap -xyzzy
19 check_exit '-eq 0' $ap -help
20 check_exit '-eq 0' $ap -version
21 check_exit '-eq 1' $ap -format foo -form
22 check_exit '-eq 1' $ap -form foo -format
23 check_exit '-eq 1' $ap -width
24 x=tendixzehn
25 l=$x$x$x$x$x
26 c=$l$l
27 check_exit '-eq 1' $ap `echo $c | sed 's/./ &/g'` 101
28 check_exit '-eq 1' $ap
29 COLUMNS=1 check_exit '-eq 0' $ap foo
30 check_exit '-eq 1' $ap -width 0 `printf 'f\357o'`
31
32 finish_test