From 1186f294d7e907788140fd71bbd4d375fa24c2e8 Mon Sep 17 00:00:00 2001 From: David Levine Date: Tue, 19 Jun 2012 21:30:54 -0500 Subject: [PATCH] Added test-ali. --- Makefile.am | 3 +- test/ali/test-ali | 100 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 102 insertions(+), 1 deletion(-) create mode 100755 test/ali/test-ali diff --git a/Makefile.am b/Makefile.am index 3f56a70..31e7109 100644 --- a/Makefile.am +++ b/Makefile.am @@ -42,7 +42,8 @@ TESTS_ENVIRONMENT = MH_OBJ_DIR=@abs_builddir@ \ ## ## Important note: the "cleanup" test should always be last ## -TESTS = test/bad-input/test-header \ +TESTS = test/ali/test-ali \ + test/bad-input/test-header \ test/burst/test-burst \ test/comp/test-comp-format \ test/folder/test-create \ diff --git a/test/ali/test-ali b/test/ali/test-ali new file mode 100755 index 0000000..7af25cc --- /dev/null +++ b/test/ali/test-ali @@ -0,0 +1,100 @@ +#!/bin/sh +###################################################### +# +# Test ali +# +###################################################### + +# Not tested: +# -normalize, -nonormalize + +set -e + +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 + +expected=$MH_TEST_DIR/$$.expected +expected_err=$MH_TEST_DIR/$$.expected_err +actual=$MH_TEST_DIR/$$.actual +actual_err=$MH_TEST_DIR/$$.actual_err + + +# check -help +cat >$expected <$actual 2>&1 +check $expected $actual + +# check -version +case `ali -v` in + ali\ --*) ;; + * ) echo "$0: ali -v generated unexpected output" 1>&2 + failed=`expr ${failed:-0} + 1`;; +esac + +# check unknown option +run_test 'ali -nonexistent' 'ali: -nonexistent unknown' + +# check with no arguments and no AliasFile profile component +run_test 'ali' '' + +# check with nonexistent alias file +run_test 'ali -alias aliases' \ + "ali: aliasing error in aliases - unable to read 'aliases'" + +cat >${MH_TEST_DIR}/Mail/aliases <