unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Austin Clements <amdragon@MIT.EDU>
To: notmuch@notmuchmail.org
Cc: tomi.ollila@iki.fi
Subject: [PATCH v2] test: Canonicalize RFC 2047 encoding and charset
Date: Mon, 19 Aug 2013 10:40:03 -0400	[thread overview]
Message-ID: <1376923203-14406-1-git-send-email-amdragon@mit.edu> (raw)
In-Reply-To: <m238q698na.fsf@guru.guru-group.fi>

RFC 2047 states that the encoding and charset in an encoded word are
case-insensitive, so force them to lower case in the reply test.  This
fixes an issue caused by GMime versions (somewhere between 2.6.10 and
2.6.16), which changed the capitalization of the encoding.
---
 test/reply |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/test/reply b/test/reply
index d4389cf..b0d854a 100755
--- a/test/reply
+++ b/test/reply
@@ -201,12 +201,14 @@ add_message '[subject]="=?iso-8859-1?q?=e0=df=e7?="' \
 	    '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
 	    '[body]="Encoding"'
 
-output=$(notmuch reply id:${gen_msg_id})
-# Note that GMime changes from Q- to B-encoding
+# GMime happens to change from Q- to B-encoding.  We canonicalize the
+# case of the encoding and charset because different versions of GMime
+# capitalize the encoding differently.
+output=$(notmuch reply id:${gen_msg_id} | perl -pe 's/=\?[^?]+\?[bB]\?/lc($&)/ge')
 test_expect_equal "$output" "\
 From: Notmuch Test Suite <test_suite@notmuchmail.org>
 Subject: Re: =?iso-8859-1?b?4N/n?=
-To: =?UTF-8?b?4piD?= <snowman@example.com>
+To: =?utf-8?b?4piD?= <snowman@example.com>
 In-Reply-To: <${gen_msg_id}>
 References: <${gen_msg_id}>
 
-- 
1.7.10.4

  reply	other threads:[~2013-08-19 14:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-18 13:52 [PATCH] test: Canonicalize RFC 2047 encoding and charset Austin Clements
2013-08-18 15:10 ` Jani Nikula
2013-08-18 18:05 ` Tomi Ollila
2013-08-19 14:40   ` Austin Clements [this message]
2013-08-19 14:43     ` [PATCH v2] " Tomi Ollila
2013-08-19 15:13       ` Jani Nikula
2013-08-20  7:16     ` David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1376923203-14406-1-git-send-email-amdragon@mit.edu \
    --to=amdragon@mit.edu \
    --cc=notmuch@notmuchmail.org \
    --cc=tomi.ollila@iki.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).