3 test_description="message-dont-reply-to-names in emacs replies"
4 . $(dirname "$0")/test-lib.sh || exit 1
5 . $NOTMUCH_SRCDIR/test/test-lib-emacs.sh || exit 1
7 EXPECTED=$NOTMUCH_SRCDIR/test/emacs-show.expected-output
11 add_email_corpus default
13 test_begin_subtest "regular expression"
14 test_emacs '(let ((message-dont-reply-to-names "notmuchmail\\|noreply\\|harvard"))
15 (notmuch-mua-new-reply
16 "id:20091117203301.GV3165@dottiness.seas.harvard.edu" nil t)
17 (test-visible-output "OUTPUT-FULL.raw"))'
19 notmuch_dir_sanitize < OUTPUT-FULL.raw > OUTPUT-FULL
20 head -6 OUTPUT-FULL > OUTPUT
23 From: Notmuch Test Suite <test_suite@notmuchmail.org>
24 To: Mikhail Gusarov <dottedmag@dottedmag.net>
25 Subject: Re: [notmuch] Working with Maildir storage?
26 In-Reply-To: <20091117203301.GV3165@dottiness.seas.harvard.edu>
28 --text follows this line--
31 test_expect_equal_file EXPECTED OUTPUT
33 test_begin_subtest "predicate"
34 test_emacs '(let ((message-dont-reply-to-names
35 (lambda (m) (string-prefix-p "Mikhail" m))))
36 (notmuch-mua-new-reply
37 "id:20091117203301.GV3165@dottiness.seas.harvard.edu" nil t)
38 (test-visible-output "OUTPUT-FULL-PRED.raw"))'
40 notmuch_dir_sanitize < OUTPUT-FULL-PRED.raw > OUTPUT-FULL-PRED
41 head -7 OUTPUT-FULL-PRED > OUTPUT-PRED
43 cat <<EOF > EXPECTED-PRED
44 From: Notmuch Test Suite <test_suite@notmuchmail.org>
45 To: Lars Kellogg-Stedman <lars@seas.harvard.edu>
46 Cc: notmuch@notmuchmail.org
47 Subject: Re: [notmuch] Working with Maildir storage?
48 In-Reply-To: <20091117203301.GV3165@dottiness.seas.harvard.edu>
50 --text follows this line--
53 test_expect_equal_file EXPECTED-PRED OUTPUT-PRED
55 test_begin_subtest "nil value"
56 test_emacs '(let ((message-dont-reply-to-names nil))
57 (notmuch-mua-new-reply
58 "id:20091117203301.GV3165@dottiness.seas.harvard.edu" nil t)
59 (test-visible-output "OUTPUT-FULL-NIL.raw"))'
61 notmuch_dir_sanitize < OUTPUT-FULL-NIL.raw > OUTPUT-FULL-NIL
62 head -7 OUTPUT-FULL-NIL > OUTPUT-NIL
64 cat <<EOF > EXPECTED-NIL
65 From: Notmuch Test Suite <test_suite@notmuchmail.org>
66 To: Lars Kellogg-Stedman <lars@seas.harvard.edu>, Mikhail Gusarov <dottedmag@dottedmag.net>
67 Cc: notmuch@notmuchmail.org
68 Subject: Re: [notmuch] Working with Maildir storage?
69 In-Reply-To: <20091117203301.GV3165@dottiness.seas.harvard.edu>
71 --text follows this line--
74 test_expect_equal_file EXPECTED-NIL OUTPUT-NIL