]> git.notmuchmail.org Git - notmuch/commitdiff
test/emacs: Add tests for `message-cite-reply-position'
authorKristoffer Balintona <krisbalintona@gmail.com>
Tue, 5 Nov 2024 05:38:07 +0000 (23:38 -0600)
committerDavid Bremner <david@tethera.net>
Sat, 24 Jan 2026 23:34:08 +0000 (08:34 +0900)
`message-cite-reply-position' affects the position of the email body
and signature relative to the email citation in email replies.

Test each of the three possible values of
`message-cite-reply-position'. If `message-cite-reply-position' is
'traditional or 'below, place the email signature below the
citation. If `message-cite-reply-position' is 'above, place the email
signature above the citation (as in Gmail-style email replies).

test/T453-emacs-reply.sh

index 0a27d0661ae29d8033a0285fbb448279d3790201..f02a2fb90cab1a93abd49675375ddef0c3d5a463 100755 (executable)
@@ -68,4 +68,135 @@ test_emacs "(notmuch-show \"id:${ID3}\")
 notmuch_dir_sanitize < OUTPUT.raw > OUTPUT
 test_expect_equal_file_nonempty $EXPECTED/notmuch-reply-duplicate-4 OUTPUT
 
+add_email_corpus default
+
+ID4=1258471718-6781-2-git-send-email-dottedmag@dottedmag.net
+test_begin_subtest "if message-cite-reply-position is 'above, position citation below signature"
+test_emacs "(let ((message-cite-reply-position 'above)
+             (message-signature \"EMAIL SIGNATURE\"))
+         (notmuch-mua-new-reply \"id:${ID4}\")
+         (test-visible-output \"OUTPUT.raw\"))"
+cat <<EOF > EXPECTED
+From: Notmuch Test Suite <test_suite@notmuchmail.org>
+To: Mikhail Gusarov <dottedmag@dottedmag.net>
+Subject: Re: [notmuch] [PATCH 2/2] Include <stdint.h> to get uint32_t in C++ file with gcc 4.4
+In-Reply-To: <1258471718-6781-2-git-send-email-dottedmag@dottedmag.net>
+Fcc: MAIL_DIR/sent
+--text follows this line--
+
+-- 
+EMAIL SIGNATURE
+
+"Mikhail Gusarov" <dottedmag@dottedmag.net> writes:
+
+> Signed-off-by: Mikhail Gusarov <dottedmag at dottedmag.net>
+> ---
+>  lib/message.cc |    2 ++
+>  1 files changed, 2 insertions(+), 0 deletions(-)
+>
+> diff --git a/lib/message.cc b/lib/message.cc
+> index 72c350f..a4b090b 100644
+> --- a/lib/message.cc
+> +++ b/lib/message.cc
+> @@ -21,6 +21,8 @@
+>  #include "notmuch-private.h"
+>  #include "database-private.h"
+>  
+> +#include <stdint.h>
+> +
+>  #include <gmime/gmime.h>
+>  
+>  #include <xapian.h>
+> -- 
+> 1.6.3.3
+EOF
+notmuch_dir_sanitize < OUTPUT.raw > OUTPUT
+test_expect_equal_file EXPECTED OUTPUT
+
+test_begin_subtest "if message-cite-reply-position is 'traditional, position citation above signature"
+test_emacs "(let ((message-cite-reply-position 'traditional)
+             (message-signature \"EMAIL SIGNATURE\"))
+         (notmuch-mua-new-reply \"id:${ID4}\")
+         (test-visible-output \"OUTPUT.raw\"))"
+cat <<EOF > EXPECTED
+From: Notmuch Test Suite <test_suite@notmuchmail.org>
+To: Mikhail Gusarov <dottedmag@dottedmag.net>
+Subject: Re: [notmuch] [PATCH 2/2] Include <stdint.h> to get uint32_t in C++ file with gcc 4.4
+In-Reply-To: <1258471718-6781-2-git-send-email-dottedmag@dottedmag.net>
+Fcc: MAIL_DIR/sent
+--text follows this line--
+"Mikhail Gusarov" <dottedmag@dottedmag.net> writes:
+
+> Signed-off-by: Mikhail Gusarov <dottedmag at dottedmag.net>
+> ---
+>  lib/message.cc |    2 ++
+>  1 files changed, 2 insertions(+), 0 deletions(-)
+>
+> diff --git a/lib/message.cc b/lib/message.cc
+> index 72c350f..a4b090b 100644
+> --- a/lib/message.cc
+> +++ b/lib/message.cc
+> @@ -21,6 +21,8 @@
+>  #include "notmuch-private.h"
+>  #include "database-private.h"
+>  
+> +#include <stdint.h>
+> +
+>  #include <gmime/gmime.h>
+>  
+>  #include <xapian.h>
+> -- 
+> 1.6.3.3
+>
+>
+
+-- 
+EMAIL SIGNATURE
+EOF
+notmuch_dir_sanitize < OUTPUT.raw > OUTPUT
+test_expect_equal_file EXPECTED OUTPUT
+
+test_begin_subtest "if message-cite-reply-position is 'below, position citation above signature"
+test_emacs "(let ((message-cite-reply-position 'below)
+             (message-signature \"EMAIL SIGNATURE\"))
+         (notmuch-mua-new-reply \"id:${ID4}\")
+         (test-visible-output \"OUTPUT.raw\"))"
+cat <<EOF > EXPECTED
+From: Notmuch Test Suite <test_suite@notmuchmail.org>
+To: Mikhail Gusarov <dottedmag@dottedmag.net>
+Subject: Re: [notmuch] [PATCH 2/2] Include <stdint.h> to get uint32_t in C++ file with gcc 4.4
+In-Reply-To: <1258471718-6781-2-git-send-email-dottedmag@dottedmag.net>
+Fcc: MAIL_DIR/sent
+--text follows this line--
+"Mikhail Gusarov" <dottedmag@dottedmag.net> writes:
+
+> Signed-off-by: Mikhail Gusarov <dottedmag at dottedmag.net>
+> ---
+>  lib/message.cc |    2 ++
+>  1 files changed, 2 insertions(+), 0 deletions(-)
+>
+> diff --git a/lib/message.cc b/lib/message.cc
+> index 72c350f..a4b090b 100644
+> --- a/lib/message.cc
+> +++ b/lib/message.cc
+> @@ -21,6 +21,8 @@
+>  #include "notmuch-private.h"
+>  #include "database-private.h"
+>  
+> +#include <stdint.h>
+> +
+>  #include <gmime/gmime.h>
+>  
+>  #include <xapian.h>
+> -- 
+> 1.6.3.3
+>
+>
+
+-- 
+EMAIL SIGNATURE
+EOF
+notmuch_dir_sanitize < OUTPUT.raw > OUTPUT
+test_expect_equal_file EXPECTED OUTPUT
+
 test_done