| 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 <[email protected]> |
| 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 <[email protected]> |
| 31 |
To: Nowhere User <[email protected]> |
| 32 |
cc: Mister User One <[email protected]> |
| 33 |
Subject: This is a subject |
| 34 |
cc: Mister User Two <[email protected]> |
| 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 <[email protected]> |
| 46 |
To: Test1 <[email protected]> |
| 47 |
cc: Mister User One <[email protected]>, |
| 48 |
Mister User Two <[email protected]> |
| 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 |
run_prog repl -editor true -cc cc -format -form $form -width 72 \ |
| 56 |
-nowhatnowproc 11 || exit 1 |
| 57 |
|
| 58 |
check "$expected" "$actual" |
| 59 |
|
| 60 |
test ${failed:-0} -eq 0 && rm "$form" |
| 61 |
|
| 62 |
exit $failed |