From: Todd Date: Thu, 22 Jan 2015 23:43:36 +0000 (+1800) Subject: [PATCH v4 1/5] test: Add failing unit tests for indexed mime types X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=33364173f39b7f4219331e98410313e5203c0750;p=notmuch-archives.git [PATCH v4 1/5] test: Add failing unit tests for indexed mime types --- diff --git a/18/1d1dbee3086b0aeb24bd145964caada6ebf1bc b/18/1d1dbee3086b0aeb24bd145964caada6ebf1bc new file mode 100644 index 000000000..da4173b52 --- /dev/null +++ b/18/1d1dbee3086b0aeb24bd145964caada6ebf1bc @@ -0,0 +1,129 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id DCFF7431FD8 + for ; Thu, 22 Jan 2015 15:44:31 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" +X-Spam-Flag: NO +X-Spam-Score: 2.438 +X-Spam-Level: ** +X-Spam-Status: No, score=2.438 tagged_above=-999 required=5 + tests=[DNS_FROM_AHBL_RHSBL=2.438] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id eTD6BH0UCY8n for ; + Thu, 22 Jan 2015 15:44:28 -0800 (PST) +Received: from s75.web-hosting.com (s75.web-hosting.com [198.187.31.9]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 4A483431FCB + for ; Thu, 22 Jan 2015 15:44:24 -0800 (PST) +Received: from user-69-73-37-128.knology.net ([69.73.37.128]:32799 + helo=localhost.localdomain) + by server75.web-hosting.com with esmtpsa (UNKNOWN:AES128-SHA256:128) + (Exim 4.82) (envelope-from ) + id 1YERQE-0036iE-09; Thu, 22 Jan 2015 18:44:22 -0500 +From: Todd +To: notmuch@notmuchmail.org +Subject: [PATCH v4 1/5] test: Add failing unit tests for indexed mime types +Date: Thu, 22 Jan 2015 17:43:36 -0600 +Message-Id: <1421970220-9019-2-git-send-email-todd@electricoding.com> +X-Mailer: git-send-email 1.9.1 +In-Reply-To: <1421970220-9019-1-git-send-email-todd@electricoding.com> +References: <1421970220-9019-1-git-send-email-todd@electricoding.com> +In-Reply-To: <1420849787-4401-1-git-send-email-todd@electricoding.com> +References: <1420849787-4401-1-git-send-email-todd@electricoding.com> +X-AntiAbuse: This header was added to track abuse, + please include it with any abuse report +X-AntiAbuse: Primary Hostname - server75.web-hosting.com +X-AntiAbuse: Original Domain - notmuchmail.org +X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] +X-AntiAbuse: Sender Address Domain - electricoding.com +X-Get-Message-Sender-Via: server75.web-hosting.com: authenticated_id: + todd@electricoding.com +X-Source: +X-Source-Args: +X-Source-Dir: +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Thu, 22 Jan 2015 23:44:32 -0000 + +Adds three failing unit tests for searching of mime-types. + +An attempt was made at adding a negative test (i.e. searching for a +non-existent mime-type and ensuring it didn't return a message), but +that test would always pass making it pointless. +--- + test/T190-multipart.sh | 39 +++++++++++++++++++++++++++++++++++++++ + 1 file changed, 39 insertions(+) + +diff --git a/test/T190-multipart.sh b/test/T190-multipart.sh +index 85cbf67..a97dc28 100755 +--- a/test/T190-multipart.sh ++++ b/test/T190-multipart.sh +@@ -104,6 +104,30 @@ Content-Transfer-Encoding: base64 + 7w0K + --==-=-=-- + EOF ++ ++cat < content_types ++From: Todd ++To: todd@example.com ++Subject: odd content types ++Date: Mon, 12 Jan 2014 18:12:32 +0000 ++User-Agent: Notmuch/0.5 (http://notmuchmail.org) Emacs/23.3.1 (i486-pc-linux-gnu) ++Message-ID: ++MIME-Version: 1.0 ++Content-Type: multipart/alternative; boundary="==-=-==" ++ ++--==-=-== ++Content-Type: application/unique_identifier ++ ++

This is an embedded message, with a multipart/alternative part.

++ ++--==-=-== ++Content-Type: text/some_other_identifier ++ ++This is an embedded message, with a multipart/alternative part. ++ ++--==-=-==-- ++EOF ++cat content_types >> ${MAIL_DIR}/odd_content_type + notmuch new > /dev/null + + test_begin_subtest "--format=text --part=0, full message" +@@ -727,4 +751,19 @@ test_begin_subtest "html parts included" + notmuch show --format=json --include-html id:htmlmessage > OUTPUT + test_expect_equal_json "$(cat OUTPUT)" "$(cat EXPECTED.withhtml)" + ++test_begin_subtest "indexes mime-type #1" ++test_subtest_known_broken ++output=$(notmuch search mimetype:application/unique_identifier | notmuch_search_sanitize) ++test_expect_equal "$output" "thread:XXX 2014-01-12 [1/1] Todd; odd content types (inbox unread)" ++ ++test_begin_subtest "indexes mime-type #2" ++test_subtest_known_broken ++output=$(notmuch search mimetype:text/some_other_identifier | notmuch_search_sanitize) ++test_expect_equal "$output" "thread:XXX 2014-01-12 [1/1] Todd; odd content types (inbox unread)" ++ ++test_begin_subtest "indexes mime-type #3" ++test_subtest_known_broken ++output=$(notmuch search from:todd and mimetype:multipart/alternative | notmuch_search_sanitize) ++test_expect_equal "$output" "thread:XXX 2014-01-12 [1/1] Todd; odd content types (inbox unread)" ++ + test_done +-- +1.9.1 +