From: Michal Sojka <sojkam1@fel.cvut.cz>
To: notmuch@notmuchmail.org
Subject: [PATCH] test: Add test for searching of uncommonly encoded messages
Date: Fri, 24 Feb 2012 01:33:15 +0100 [thread overview]
Message-ID: <1330043595-22054-1-git-send-email-sojkam1@fel.cvut.cz> (raw)
In-Reply-To: <877gzd5axk.fsf@steelpick.2x.cz>
Emails that are encoded differently than as ASCII or UTF-8 are not
indexed properly by notmuch. It is not possible to search for non-ASCII
words within those messages.
---
test/encoding | 9 +++++++++
test/test-lib.sh | 5 +++++
2 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/test/encoding b/test/encoding
index 33259c1..3992b5c 100755
--- a/test/encoding
+++ b/test/encoding
@@ -21,4 +21,13 @@ irrelevant
\fbody}
\fmessage}"
+test_begin_subtest "Search for ISO-8859-2 encoded message"
+test_subtest_known_broken
+add_message '[content-type]="text/plain; charset=iso-8859-2"' \
+ '[content-transfer-encoding]=8bit' \
+ '[subject]="ISO-8859-2 encoded message"' \
+ "[body]=$'Czech word tu\350\362\341\350\350\355 means pinguin\'s.'" # ISO-8859-2 characters are generated by shell's escape sequences
+output=$(notmuch search tučňáččí 2>&1 | notmuch_show_sanitize)
+test_expect_equal "$output" "thread:0000000000000002 2001-01-05 [1/1] Notmuch Test Suite; ISO-8859-2 encoded message (inbox unread)"
+
test_done
diff --git a/test/test-lib.sh b/test/test-lib.sh
index 063a2b2..2781506 100644
--- a/test/test-lib.sh
+++ b/test/test-lib.sh
@@ -356,6 +356,11 @@ ${additional_headers}"
${additional_headers}"
fi
+ if [ ! -z "${template[content-transfer-encoding]}" ]; then
+ additional_headers="Content-Transfer-Encoding: ${template[content-transfer-encoding]}
+${additional_headers}"
+ fi
+
# Note that in the way we're setting it above and using it below,
# `additional_headers' will also serve as the header / body separator
# (empty line in between).
--
1.7.9.1
next prev parent reply other threads:[~2012-02-24 0:33 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-22 17:10 Searching through different charsets Serge Z
2012-02-24 0:31 ` Michal Sojka
2012-02-24 0:33 ` Michal Sojka [this message]
2012-02-24 4:29 ` [PATCH] test: Add test for searching of uncommonly encoded messages Serge Z
2012-02-24 7:00 ` Michal Sojka
2012-02-24 7:57 ` Serge Z
2012-02-24 8:38 ` Michal Sojka
2012-02-25 8:36 ` Serge Z
2012-02-26 9:33 ` Double decoded text/html parts (was: [PATCH] test: Add test for searching of uncommonly encoded messages) Michal Sojka
2012-02-26 10:20 ` Serge Z
2012-02-24 7:36 ` [PATCH 1/2] Convert non-UTF-8 parts to UTF-8 before indexing them Michal Sojka
2012-02-24 7:36 ` [PATCH 2/2] test: Remove 'broken' flag from encoding test Michal Sojka
2012-02-25 4:33 ` [PATCH 1/2] Convert non-UTF-8 parts to UTF-8 before indexing them Austin Clements
2012-02-29 11:55 ` David Bremner
2012-02-29 11:55 ` [PATCH] test: Add test for searching of uncommonly encoded messages 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=1330043595-22054-1-git-send-email-sojkam1@fel.cvut.cz \
--to=sojkam1@fel.cvut.cz \
--cc=notmuch@notmuchmail.org \
/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).