]> diplodocus.org Git - nmh/blob - test/format/test-rightjustify
sbr/utils.c: Add HasSuffix(s, suffix).
[nmh] / test / format / test-rightjustify
1 #!/bin/sh
2 #
3 # Test that the right justification feature works correctly.
4 #
5
6 if test -z "${MH_OBJ_DIR}"; then
7 srcdir=`dirname "$0"`/../..
8 MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR
9 fi
10
11 . "$MH_OBJ_DIR/test/common.sh"
12
13 setup_test
14
15 actual=`run_prog ${MH_LIBEXEC_DIR}/ap -format "%-30(friendly{text})<<End of test" "No Such User <nosuch@user.com>"`
16 expected=" No Such User<<End of test"
17 ##########123456789012345678901234567890
18
19 if test x"$actual" != x"$expected"; then
20 echo "$0: right justification test expected:" 1>&2
21 echo " $expected" 1>&2
22 echo "but instead got:" 1>&2
23 echo " $actual" 1>&2
24 failed=`expr ${failed:-0} + 1`
25 fi
26
27 exit $failed