]> git.cworth.org Git - notmuch-old/blob - test/T453-emacs-reply.sh
tests: remove dead code from T055-path-config.sh
[notmuch-old] / test / T453-emacs-reply.sh
1 #!/usr/bin/env bash
2
3 test_description="emacs reply"
4 . $(dirname "$0")/test-lib.sh || exit 1
5 . $NOTMUCH_SRCDIR/test/test-lib-emacs.sh || exit 1
6
7 EXPECTED=$NOTMUCH_SRCDIR/test/emacs-reply.expected-output
8
9 test_require_emacs
10
11 add_email_corpus attachment
12
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")'
16 cat <<EOF > EXPECTED
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>
21 Fcc: MAIL_DIR/sent
22 --text follows this line--
23 Antoine Beaupré <anarcat@orangeseeds.org> writes:
24
25 > And obviously I forget the frigging attachment.
26 >
27 >
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
30 EOF
31 notmuch_dir_sanitize < OUTPUT.raw > OUTPUT
32 test_expect_equal_file EXPECTED OUTPUT
33
34 add_email_corpus duplicate
35
36 ID2=87r2geywh9.fsf@tethera.net
37 for dup in {1..2}; do
38     test_begin_subtest "body, duplicate=${dup}"
39     test_emacs "(notmuch-show \"id:${ID2}\")
40            (notmuch-test-wait)
41            (notmuch-show-choose-duplicate $dup)
42            (notmuch-test-wait)
43            (notmuch-show-reply)
44            (test-visible-output \"OUTPUT.raw\")"
45     output=$(grep '^> # body' OUTPUT.raw)
46     test_expect_equal "$output" "> # body ${dup}"
47 done
48
49 ID3=87r2ecrr6x.fsf@zephyr.silentflame.com
50 test_begin_subtest "duplicate=3, subject"
51 test_emacs "(notmuch-show \"id:${ID3}\")
52            (notmuch-test-wait)
53            (notmuch-show-choose-duplicate 3)
54            (notmuch-test-wait)
55            (notmuch-show-reply)
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"
61
62 test_begin_subtest "duplicate=4"
63 test_emacs "(notmuch-show \"id:${ID3}\")
64            (notmuch-show-choose-duplicate 4)
65            (notmuch-test-wait)
66            (notmuch-show-reply)
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
70
71 test_done