[PATCH] test: Add test for searching of uncommonly encoded messages
authorMichal Sojka <sojkam1@fel.cvut.cz>
Fri, 24 Feb 2012 00:33:15 +0000 (01:33 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:44:53 +0000 (09:44 -0800)
10/2d559a064efc0ba39195939d23eed990b272d2 [new file with mode: 0644]

diff --git a/10/2d559a064efc0ba39195939d23eed990b272d2 b/10/2d559a064efc0ba39195939d23eed990b272d2
new file mode 100644 (file)
index 0000000..eeb947d
--- /dev/null
@@ -0,0 +1,109 @@
+Return-Path: <sojkam1@fel.cvut.cz>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 11041431FAE\r
+       for <notmuch@notmuchmail.org>; Thu, 23 Feb 2012 16:33:40 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -2.3\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id hzCvSD7vRHJK for <notmuch@notmuchmail.org>;\r
+       Thu, 23 Feb 2012 16:33:38 -0800 (PST)\r
+Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36])\r
+       by olra.theworths.org (Postfix) with ESMTP id E6A09431FC3\r
+       for <notmuch@notmuchmail.org>; Thu, 23 Feb 2012 16:33:37 -0800 (PST)\r
+Received: from localhost (unknown [192.168.200.4])\r
+       by max.feld.cvut.cz (Postfix) with ESMTP id 82F873CFEB7;\r
+       Fri, 24 Feb 2012 01:33:36 +0100 (CET)\r
+X-Virus-Scanned: IMAP AMAVIS\r
+Received: from max.feld.cvut.cz ([192.168.200.1])\r
+       by localhost (styx.feld.cvut.cz [192.168.200.4]) (amavisd-new,\r
+       port 10044)\r
+       with ESMTP id mz5evMUfLTKr; Fri, 24 Feb 2012 01:33:35 +0100 (CET)\r
+Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34])\r
+       by max.feld.cvut.cz (Postfix) with ESMTP id A05B83CFEB0;\r
+       Fri, 24 Feb 2012 01:33:35 +0100 (CET)\r
+Received: from steelpick.2x.cz (cable-86-56-3-85.cust.telecolumbus.net\r
+       [86.56.3.85]) (Authenticated sender: sojkam1)\r
+       by imap.feld.cvut.cz (Postfix) with ESMTPSA id 89809660968;\r
+       Fri, 24 Feb 2012 01:33:35 +0100 (CET)\r
+Received: from wsh by steelpick.2x.cz with local (Exim 4.77)\r
+       (envelope-from <sojkam1@fel.cvut.cz>)\r
+       id 1S0j6M-0005kf-UD; Fri, 24 Feb 2012 01:33:34 +0100\r
+From: Michal Sojka <sojkam1@fel.cvut.cz>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] test: Add test for searching of uncommonly encoded messages\r
+Date: Fri, 24 Feb 2012 01:33:15 +0100\r
+Message-Id: <1330043595-22054-1-git-send-email-sojkam1@fel.cvut.cz>\r
+X-Mailer: git-send-email 1.7.9.1\r
+In-Reply-To: <877gzd5axk.fsf@steelpick.2x.cz>\r
+References: <877gzd5axk.fsf@steelpick.2x.cz>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=UTF-8\r
+Content-Transfer-Encoding: 8bit\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Fri, 24 Feb 2012 00:33:40 -0000\r
+\r
+Emails that are encoded differently than as ASCII or UTF-8 are not\r
+indexed properly by notmuch. It is not possible to search for non-ASCII\r
+words within those messages.\r
+---\r
+ test/encoding    |    9 +++++++++\r
+ test/test-lib.sh |    5 +++++\r
+ 2 files changed, 14 insertions(+), 0 deletions(-)\r
+\r
+diff --git a/test/encoding b/test/encoding\r
+index 33259c1..3992b5c 100755\r
+--- a/test/encoding\r
++++ b/test/encoding\r
+@@ -21,4 +21,13 @@ irrelevant\r
\f\r
+body}\r
\f\r
+message}"\r
\r
++test_begin_subtest "Search for ISO-8859-2 encoded message"\r
++test_subtest_known_broken\r
++add_message '[content-type]="text/plain; charset=iso-8859-2"' \\r
++            '[content-transfer-encoding]=8bit' \\r
++            '[subject]="ISO-8859-2 encoded message"' \\r
++            "[body]=$'Czech word tu\350\362\341\350\350\355 means pinguin\'s.'" # ISO-8859-2 characters are generated by shell's escape sequences\r
++output=$(notmuch search tučňáččí 2>&1 | notmuch_show_sanitize)\r
++test_expect_equal "$output" "thread:0000000000000002   2001-01-05 [1/1] Notmuch Test Suite; ISO-8859-2 encoded message (inbox unread)"\r
++\r
+ test_done\r
+diff --git a/test/test-lib.sh b/test/test-lib.sh\r
+index 063a2b2..2781506 100644\r
+--- a/test/test-lib.sh\r
++++ b/test/test-lib.sh\r
+@@ -356,6 +356,11 @@ ${additional_headers}"\r
+ ${additional_headers}"\r
+     fi\r
\r
++    if [ ! -z "${template[content-transfer-encoding]}" ]; then\r
++      additional_headers="Content-Transfer-Encoding: ${template[content-transfer-encoding]}\r
++${additional_headers}"\r
++    fi\r
++\r
+     # Note that in the way we're setting it above and using it below,\r
+     # `additional_headers' will also serve as the header / body separator\r
+     # (empty line in between).\r
+-- \r
+1.7.9.1\r
+\r