3 test_description="emacs reply"
4 . $(dirname "$0")/test-lib.sh || exit 1
5 . $NOTMUCH_SRCDIR/test/test-lib-emacs.sh || exit 1
7 EXPECTED=$NOTMUCH_SRCDIR/test/emacs-reply.expected-output
11 add_email_corpus attachment
13 test_begin_subtest "tar not inlined by default"
14 test_emacs '(notmuch-mua-new-reply "id:874llc2bkp.fsf@curie.anarc.at")
15 (test-visible-output "OUTPUT.raw")'
17 From: Notmuch Test Suite <test_suite@notmuchmail.org>
18 To: Antoine Beaupré <anarcat@orangeseeds.org>
19 Subject: Re: bug: "no top level messages" crash on Zen email loops
20 In-Reply-To: <874llc2bkp.fsf@curie.anarc.at>
22 --text follows this line--
23 Antoine Beaupré <anarcat@orangeseeds.org> writes:
25 > And obviously I forget the frigging attachment.
28 > PS: don't we have a "you forgot to actually attach the damn file" plugin
29 > when we detect the word "attachment" and there's no attach? :p
31 notmuch_dir_sanitize < OUTPUT.raw > OUTPUT
32 test_expect_equal_file EXPECTED OUTPUT
34 add_email_corpus duplicate
36 ID2=87r2geywh9.fsf@tethera.net
38 test_begin_subtest "body, duplicate=${dup}"
39 test_emacs "(notmuch-show \"id:${ID2}\")
41 (notmuch-show-choose-duplicate $dup)
44 (test-visible-output \"OUTPUT.raw\")"
45 output=$(grep '^> # body' OUTPUT.raw)
46 test_expect_equal "$output" "> # body ${dup}"
49 ID3=87r2ecrr6x.fsf@zephyr.silentflame.com
50 test_begin_subtest "duplicate=3, subject"
51 test_emacs "(notmuch-show \"id:${ID3}\")
53 (notmuch-show-choose-duplicate 3)
56 (test-visible-output \"OUTPUT\")"
57 output=$(sed -n 's/^Subject: //p' OUTPUT)
58 file=$(notmuch search --output=files id:${ID3} | head -n 3 | tail -n 1)
59 subject=$(sed -n 's/^Subject: //p' $file)
60 test_expect_equal "$output" "Re: $subject"
62 test_begin_subtest "duplicate=4"
63 test_emacs "(notmuch-show \"id:${ID3}\")
64 (notmuch-show-choose-duplicate 4)
67 (test-visible-output \"OUTPUT.raw\")"
68 notmuch_dir_sanitize < OUTPUT.raw > OUTPUT
69 test_expect_equal_file_nonempty $EXPECTED/notmuch-reply-duplicate-4 OUTPUT