aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2022-07-01 18:45:48 -0300
committerDavid Bremner <david@tethera.net>2022-07-30 08:46:22 -0300
commit1ef7c75111b84ea19af3186ddc12f2ba434c93de (patch)
tree652e825736a3f67878ed47844be69abca8cbe750 /test
parent24decfc1dd294b7546da53890f1c4d16105cc8d6 (diff)
emacs/reply: reply to correct duplicate
Essentially we just need to arrange to pass the right --duplicate argument to notmuch reply. As a side-effect, correct the previously unused value of EXPECTED in T453-emacs-reply.sh.
Diffstat (limited to 'test')
-rwxr-xr-xtest/T453-emacs-reply.sh39
-rw-r--r--test/emacs-reply.expected-output/notmuch-reply-duplicate-421
2 files changed, 59 insertions, 1 deletions
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
diff --git a/test/emacs-reply.expected-output/notmuch-reply-duplicate-4 b/test/emacs-reply.expected-output/notmuch-reply-duplicate-4
new file mode 100644
index 00000000..836f77b1
--- /dev/null
+++ b/test/emacs-reply.expected-output/notmuch-reply-duplicate-4
@@ -0,0 +1,21 @@
+From: Notmuch Test Suite <test_suite@notmuchmail.org>
+To: Sean Whitton <spwhitton@spwhitton.name>, 916811@bugs.debian.org, 916805@bugs.debian.org, 916807@bugs.debian.org, 916808@bugs.debian.org, 916809@bugs.debian.org, 916811@bugs.debian.org, 916867@bugs.debian.org, 916869@bugs.debian.org, 916872@bugs.debian.org, 916875@bugs.debian.org, 916876@bugs.debian.org
+Subject: Re: [Pkg-emacsen-addons] Bug#916811: Increase severity to 'serious'
+In-Reply-To: <87r2ecrr6x.fsf@zephyr.silentflame.com>
+Fcc: MAIL_DIR/sent
+--text follows this line--
+Sean Whitton <spwhitton@spwhitton.name> writes:
+
+> control: severity -1 serious
+>
+> Hello,
+>
+> Emacs 26.1 has reached Debian unstable (sooner than expected; sorry for
+> all the e-mails).
+>
+> --
+> Sean Whitton
+> _______________________________________________
+> Pkg-emacsen-addons mailing list
+> Pkg-emacsen-addons@alioth-lists.debian.net
+> https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/pkg-emacsen-addons