A test for forw -digest. It doesn't quite work yet.
authorKen Hornstein <kenh@pobox.com>
Mon, 27 Feb 2012 02:29:01 +0000 (21:29 -0500)
committerKen Hornstein <kenh@pobox.com>
Mon, 27 Feb 2012 02:29:01 +0000 (21:29 -0500)
Makefile.am
etc/digestcomps
test/forw/test-forw-digest [new file with mode: 0755]

index 0889486..8ab7a72 100644 (file)
@@ -45,6 +45,7 @@ TESTS = test/bad-input/test-header test/comp/test-comp-format \
        test/folder/test-total test/format/test-localmbox \
        test/format/test-myname test/format/test-myhost \
        test/format/test-mymbox test/forw/test-forw-format \
+       test/forw/test-forw-digest \
        test/inc/test-deb359167 test/inc/test-eom-align \
        test/manpages/test-manpages test/mhbuild/test-forw \
        test/mhpath/test-mhpath \
index fdb55f8..5b310d5 100644 (file)
@@ -1,5 +1,5 @@
-From:    %{digest}-Request
-To:      %{digest} Distribution: dist-%{digest};
+%<{nmh-from}%(void(width))%(putaddr From:         )%|From:       %{digest}-Request%>
+%<{nmh-to}%(void(width))%(putaddr To:     )%|To:         %{digest} Distribution: dist-%{digest};%>
 Subject:  %{digest} Digest V%(cur) #%(msg)
 Reply-To: %{digest}
 --------
diff --git a/test/forw/test-forw-digest b/test/forw/test-forw-digest
new file mode 100755 (executable)
index 0000000..9d62fc8
--- /dev/null
@@ -0,0 +1,50 @@
+#!/bin/sh
+#
+# Tests to see if "forw -digest" works correctly.
+#
+
+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"
+actual="${MH_TEST_DIR}/Mail/draft"
+from="Mr Test User <test@user.com>"
+to1="User One <userone@test.com>"
+to2="User Two <usertwo@test.com>"
+cc1="CC User One <ccuserone@test.com>"
+cc2="CC User Two <ccusertwo@test.com>"
+cc3="CC User Three <ccuserthree@test.com>"
+cc4="CC User Four <ccuserfour@test.com>"
+fcc1="+nosuchmailbox"
+fcc2="+nosuchmailbox2"
+
+cat > "$expected" <<EOF
+From: ${from}
+To: ${to1}, ${to2}
+cc: ${cc1},
+    ${cc2},
+    ${cc3},
+    ${cc4}
+Fcc: ${fcc1}, ${fcc2}
+Subject: foo
+--------
+
+
+EOF
+
+forw -editor true -from "${from}" -to "${to1}" -to "${to2}" \
+    -cc "${cc1}" -cc "${cc2}" -cc "${cc3}" -cc "${cc4}" -fcc "${fcc1}" \
+    -fcc "${fcc2}" -width 60 -nowhatnowproc 1 \
+    -digest digest-test +inbox 1-6 || exit 1
+
+check "${expected}" "${actual}"
+
+test "${failed:-0}" -eq 0 && rm "${form}"
+
+exit $failed