]>
diplodocus.org Git - nmh/blob - test/format/test-ap
3 # Tests for ap(8)'s coverage.
5 if test -z "${MH_OBJ_DIR}"; then
6 srcdir
=`dirname "$0"`/..
/..
7 MH_OBJ_DIR
=`cd "$srcdir" && pwd`; export MH_OBJ_DIR
10 .
"$MH_OBJ_DIR/test/common.sh"
14 # Use proper program, likely not the first one on PATH.
15 ap
="${MH_LIBEXEC_DIR}/ap"
17 start_test
'ambiguous switch'
18 check_exit
'-eq 1' $ap -
19 start_test
'invalid switch'
20 check_exit
'-eq 1' $ap -xyzzy
22 check_exit
'-eq 0' $ap -help
24 check_exit
'-eq 0' $ap -version
25 start_test
'missing -form argument'
26 check_exit
'-eq 1' $ap -format foo
-form
27 start_test
'missing -format argument'
28 check_exit
'-eq 1' $ap -form foo
-format
29 start_test
'missing -width argument'
30 check_exit
'-eq 1' $ap -width
34 start_test
'more than 100 addresses'
35 check_exit
'-eq 1' $ap `echo $c | sed 's/./ &/g'` 101
36 start_test
'no addresses'
37 check_exit
'-eq 1' $ap
38 start_test
'success, though alias not found'
39 COLUMNS
=1 check_exit
'-eq 0' $ap foo
41 #### Make sure that 8-bit character is properly interpreted.
42 require_locale en_US.UTF
-8 en_US.UTF8 en_US.utf
-8 en_US.utf8
43 start_test
'address with 8-bit character'
44 check_exit
'-eq 1' $ap -width 0 `printf 'f\357o'`