X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=test%2FT453-emacs-reply.sh;h=0a27d0661ae29d8033a0285fbb448279d3790201;hp=c26c4473019ca8a6d47f3d2191e5157c5a975792;hb=1ef7c75111b84ea19af3186ddc12f2ba434c93de;hpb=24decfc1dd294b7546da53890f1c4d16105cc8d6 diff --git a/test/T453-emacs-reply.sh b/test/T453-emacs-reply.sh index c26c4473..0a27d066 100755 --- a/test/T453-emacs-reply.sh +++ b/test/T453-emacs-reply.sh @@ -4,7 +4,7 @@ test_description="emacs reply" . $(dirname "$0")/test-lib.sh || exit 1 . $NOTMUCH_SRCDIR/test/test-lib-emacs.sh || exit 1 -EXPECTED=$NOTMUCH_SRCDIR/test/emacs-show.expected-output +EXPECTED=$NOTMUCH_SRCDIR/test/emacs-reply.expected-output test_require_emacs @@ -31,4 +31,41 @@ EOF notmuch_dir_sanitize < OUTPUT.raw > OUTPUT test_expect_equal_file EXPECTED OUTPUT +add_email_corpus duplicate + +ID2=87r2geywh9.fsf@tethera.net +for dup in {1..2}; do + test_begin_subtest "body, duplicate=${dup}" + test_emacs "(notmuch-show \"id:${ID2}\") + (notmuch-test-wait) + (notmuch-show-choose-duplicate $dup) + (notmuch-test-wait) + (notmuch-show-reply) + (test-visible-output \"OUTPUT.raw\")" + output=$(grep '^> # body' OUTPUT.raw) + test_expect_equal "$output" "> # body ${dup}" +done + +ID3=87r2ecrr6x.fsf@zephyr.silentflame.com +test_begin_subtest "duplicate=3, subject" +test_emacs "(notmuch-show \"id:${ID3}\") + (notmuch-test-wait) + (notmuch-show-choose-duplicate 3) + (notmuch-test-wait) + (notmuch-show-reply) + (test-visible-output \"OUTPUT\")" +output=$(sed -n 's/^Subject: //p' OUTPUT) +file=$(notmuch search --output=files id:${ID3} | head -n 3 | tail -n 1) +subject=$(sed -n 's/^Subject: //p' $file) +test_expect_equal "$output" "Re: $subject" + +test_begin_subtest "duplicate=4" +test_emacs "(notmuch-show \"id:${ID3}\") + (notmuch-show-choose-duplicate 4) + (notmuch-test-wait) + (notmuch-show-reply) + (test-visible-output \"OUTPUT.raw\")" +notmuch_dir_sanitize < OUTPUT.raw > OUTPUT +test_expect_equal_file_nonempty $EXPECTED/notmuch-reply-duplicate-4 OUTPUT + test_done