2 ######################################################
6 ######################################################
10 expected=$MH_TEST_DIR/$$.expected
11 expected_err=$MH_TEST_DIR/$$.expected_err
12 actual=$MH_TEST_DIR/$$.actual
13 actual_err=$MH_TEST_DIR/$$.actual_err
16 runandcheck "ali -help" <<!
17 Usage: ali [switches] aliases ...
31 * ) echo "$0: ali -V generated unexpected output" 1>&2
32 failed=`expr "${failed:-0}" + 1`;;
36 # check with no arguments and no AliasFile profile component
40 # check with nonexistent alias file
41 runandcheck 'ali -file nonexistent || :' <<!
42 ali: aliasing error in nonexistent: unable to read 'nonexistent'
45 cat >"${MH_TEST_DIR}/Mail/aliases" <<EOF
47 rush: geddy, alex, neil
48 geddy: geddy@example.com
49 alex: alex@example.com
50 neil: neil@example.com
54 runandcheck "ali -file ${MH_TEST_DIR}/Mail/aliases" <<!
56 rush: geddy@example.com, alex@example.com, neil@example.com
57 geddy: geddy@example.com
58 alex: alex@example.com
59 neil: neil@example.com
62 # check for a specific alias
63 runandcheck "ali -file ${MH_TEST_DIR}/Mail/aliases rush" <<!
64 geddy@example.com, alex@example.com, neil@example.com
67 # check for a specific alias that doesn't exist
68 runandcheck "ali -file ${MH_TEST_DIR}/Mail/aliases nonexistent" <<!
73 runandcheck "ali -file ${MH_TEST_DIR}/Mail/aliases -list" <<!
75 rush: geddy@example.com
78 geddy: geddy@example.com
79 alex: alex@example.com
80 neil: neil@example.com
83 # check -nolist, which is the default
84 runandcheck "ali -file ${MH_TEST_DIR}/Mail/aliases -list -nolist" <<!
86 rush: geddy@example.com, alex@example.com, neil@example.com
87 geddy: geddy@example.com
88 alex: alex@example.com
89 neil: neil@example.com
93 runandcheck "ali -file ${MH_TEST_DIR}/Mail/aliases -user geddy@example.com" <<!
99 "ali -file ${MH_TEST_DIR}/Mail/aliases -user -nouser geddy@example.com" <<!
103 # check expansion of first address of blind list [Bug #15604]
104 cat >"${MH_TEST_DIR}/Mail/aliases" <<EOF
105 rush: Rush: geddy, alex, neil
106 geddy: geddy@example.com
107 alex: alex@example.com
108 neil: neil@example.com
111 runandcheck "ali -file ${MH_TEST_DIR}/Mail/aliases rush" <<!
112 Rush: geddy@example.com, alex@example.com, neil@example.com
115 # check that aliases followed by ; are not expanded [Bug #15604]
116 cat >"${MH_TEST_DIR}/Mail/aliases" <<EOF
117 rush: Rush: geddy, alex, neil;
118 geddy: geddy@example.com
119 alex: alex@example.com
120 neil: neil@example.com
123 runandcheck "ali -file ${MH_TEST_DIR}/Mail/aliases rush" <<!
124 Rush: geddy@example.com, alex@example.com, neil;