Cleaned up message_id().
[mmh] / test / repl / test-trailing-newline
1 #!/bin/sh
2 #
3 # Test to make sure repl doesn't put trailing spaces at the end of components
4 # (like subject)
5 #
6
7 set -e
8
9 if test -z "${MH_OBJ_DIR}"; then
10     srcdir=`dirname "$0"`/../..
11     MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR
12 fi
13
14 . "$MH_OBJ_DIR/test/common.sh"
15
16 setup_test
17
18 # create test replcomps
19 form="$MH_TEST_DIR/$$.replcomps"
20 cat > "$form" <<EOF
21 From: Nowhere User <nowhere@example.com>
22 %(lit)%(formataddr %<{reply-to}%?{from}%>)\
23 %<(nonnull)%(void(width))%(putaddr To: )\n%>\
24 %<{subject}Subject: Re: %{subject}\n%>\
25 --------
26 EOF
27
28 expected="$MH_TEST_DIR/$$.expected"
29 actual="$MH_TEST_DIR/Mail/draft"
30
31 cat > "$expected" <<EOF
32 From: Nowhere User <nowhere@example.com>
33 To: Test1 <test1@example.com>
34 Subject: Re: Testing message 1
35 --------
36 Test1 writes:
37 > This is message number 1
38 EOF
39
40 repl -editor true -format -form $form -nowhatnowproc 1 || exit 1
41
42 check "$expected" "$actual"
43
44 test ${failed:-0} -eq 0  &&  rm "$form"
45
46 exit $failed