Changed msg_style and msg_delim to be file static to m_getfld.c
[mmh] / test / repl / test-multicomp
1 #!/bin/sh
2 #
3 # See if we handle multiple components of the same name correctly.
4 #
5
6 set -e
7
8 if test -z "${MH_OBJ_DIR}"; then
9     srcdir=`dirname "$0"`/../..
10     MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR
11 fi
12
13 . "$MH_OBJ_DIR/test/common.sh"
14
15 setup_test
16
17 # create test replcomps
18 form="$MH_TEST_DIR/$$.replcomps"
19 cat > "$form" <<EOF
20 From: Nowhere User <nowhere@example.com>
21 %(lit)%(formataddr %<{reply-to}%?{from}%>)\
22 %<(nonnull)%(void(width))%(putaddr To: )\n%>\
23 %(lit)%(formataddr{cc})\
24 %<(nonnull)%(void(width))%(putaddr cc: )\n%>\
25 %<{subject}Subject: Re: %{subject}\n%>\
26 --------
27 EOF
28
29 cat > "${MH_TEST_DIR}/Mail/inbox/11" <<EOF
30 From: Test1 <test1@example.com>
31 To: Nowhere User <nowhere@example.com>
32 cc: Mister User One <mruserone@example.com>
33 Subject: This is a subject
34 cc: Mister User Two <mrusertwo@example.com>
35 Subject: that got continued on another line
36 Date: 28 Sep 2006 03:04:05 -0400
37
38 This is a new test message
39 EOF
40
41 expected="$MH_TEST_DIR/$$.expected"
42 actual="$MH_TEST_DIR/Mail/draft"
43
44 cat > "$expected" <<EOF
45 From: Nowhere User <nowhere@example.com>
46 To: Test1 <test1@example.com>
47 cc: Mister User One <mruserone@example.com>,
48     Mister User Two <mrusertwo@example.com>
49 Subject: Re: This is a subject that got continued on another line
50 --------
51 Test1 writes:
52 > This is a new test message
53 EOF
54
55 repl -editor true -cc cc -format -form $form -width 72 -nowhatnowproc 11 \
56                                                 || exit 1
57
58 check "$expected" "$actual"
59
60 test ${failed:-0} -eq 0  &&  rm "$form"
61
62 exit $failed