test/folder/test-create test/folder/test-nocreate \
test/folder/test-packf test/folder/test-recurse \
test/folder/test-sortm test/folder/test-total \
+ test/format/test-ap \
test/format/test-curses test/format/test-dp \
test/format/test-fmtdump test/format/test-functions \
test/format/test-localmbox test/format/test-myname \
--- /dev/null
+#!/bin/sh
+
+# Tests for ap(8)'s coverage.
+
+if test -z "${MH_OBJ_DIR}"; then
+ srcdir=`dirname "$0"`/../..
+ MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR
+fi
+
+. "$MH_OBJ_DIR/test/common.sh"
+
+setup_test
+
+# Use proper program, likely not the first one on PATH.
+ap="${MH_LIBEXEC_DIR}/ap"
+
+check_exit '-eq 1' $ap -
+check_exit '-eq 1' $ap -xyzzy
+check_exit '-eq 0' $ap -help
+check_exit '-eq 0' $ap -version
+check_exit '-eq 1' $ap -format foo -form
+check_exit '-eq 1' $ap -form foo -format
+check_exit '-eq 1' $ap -width
+x=tendixzehn
+l=$x$x$x$x$x
+c=$l$l
+check_exit '-eq 1' $ap `echo $c | sed 's/./ &/g'` 101
+check_exit '-eq 1' $ap
+COLUMNS=1 check_exit '-eq 0' $ap foo
+check_exit '-eq 1' $ap -width 0 `printf 'f\357o'`
+
+finish_test