From: Jani Nikula Date: Thu, 15 Jan 2015 17:09:20 +0000 (+0200) Subject: Re: [PATCH v2 1/5] Add a failing unit test for indexed mime types X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=caa5e594ed73b65999e7bb5f56c1d5a2a19ac808;p=notmuch-archives.git Re: [PATCH v2 1/5] Add a failing unit test for indexed mime types --- diff --git a/6f/d135b4648f3326fa844d7b52161e4b42093c2e b/6f/d135b4648f3326fa844d7b52161e4b42093c2e new file mode 100644 index 000000000..698699761 --- /dev/null +++ b/6f/d135b4648f3326fa844d7b52161e4b42093c2e @@ -0,0 +1,147 @@ +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 68803431FD5 + for ; Thu, 15 Jan 2015 09:09:16 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 1.738 +X-Spam-Level: * +X-Spam-Status: No, score=1.738 tagged_above=-999 required=5 + tests=[DNS_FROM_AHBL_RHSBL=2.438, RCVD_IN_DNSWL_LOW=-0.7] + 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 W7h74sKjC-gg for ; + Thu, 15 Jan 2015 09:09:13 -0800 (PST) +Received: from mail-wg0-f41.google.com (mail-wg0-f41.google.com + [74.125.82.41]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client + certificate requested) by olra.theworths.org (Postfix) with ESMTPS id + D5701431FBC for ; Thu, 15 Jan 2015 09:09:12 -0800 + (PST) +Received: by mail-wg0-f41.google.com with SMTP id l18so16201237wgh.0 + for ; Thu, 15 Jan 2015 09:09:10 -0800 (PST) +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20130820; + h=x-gm-message-state:from:to:subject:in-reply-to:references + :user-agent:date:message-id:mime-version:content-type; + bh=sNQqIgLvib/CWrCWgcw2VsS4dX43WMRzvIXO6DLiT0k=; + b=AsbFxeuaA66WB0IyFb37Qf3QlbvpkYGkSvp1C0fOgjZSdFn8h98bs+/FIRg3OKAG7c + Ce/BFrgo2uJXcy+2DoWE+u+bFNW5oInL6ZLMgXoxai7BX+r0FCrnnZwWnpe4fQOFEil/ + sN2BjNjzoAwzVM8niRRCbhR8+UVCccWeXfPu61IS3bRootWcqRx8Owir9n0ubhCOzUMW + z/2sG+QaXC6a2n/R0DdSbFH+aBaKeHMxWQdFU3EjBjjcyEhBbaFH+14V6GgYCqdiHNLp + 2JbqcvAVdNEUU/7Su/y34HNQiAluJqeGGYfWArrfae0LNe8c1h0+c4KOFdRfgWcY0A6M + C6AQ== +X-Gm-Message-State: + ALoCoQnSKlEEfiZ4eaW0cntD5ph6RThAiIA3Cja6F8kFZzaC7iOY95b9WYId60w+xkp4aJxl1OU7 +X-Received: by 10.194.240.201 with SMTP id wc9mr674249wjc.57.1421341749620; + Thu, 15 Jan 2015 09:09:09 -0800 (PST) +Received: from localhost (mobile-internet-bcee14-89.dhcp.inet.fi. + [188.238.20.89]) + by mx.google.com with ESMTPSA id x2sm2834651wjx.9.2015.01.15.09.09.08 + (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); + Thu, 15 Jan 2015 09:09:08 -0800 (PST) +From: Jani Nikula +To: Todd , notmuch@notmuchmail.org +Subject: Re: [PATCH v2 1/5] Add a failing unit test for indexed mime types +In-Reply-To: <1421193628-2699-2-git-send-email-todd@electricoding.com> +References: <1421193628-2699-1-git-send-email-todd@electricoding.com> + <1421193628-2699-2-git-send-email-todd@electricoding.com> +User-Agent: Notmuch/0.19+19~g9060a1f (http://notmuchmail.org) Emacs/24.4.1 + (x86_64-pc-linux-gnu) +Date: Thu, 15 Jan 2015 19:09:20 +0200 +Message-ID: <87a91k9dj3.fsf@nikula.org> +MIME-Version: 1.0 +Content-Type: text/plain +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, 15 Jan 2015 17:09:16 -0000 + +On Wed, 14 Jan 2015, Todd wrote: +> --- +> test/T190-multipart.sh | 32 ++++++++++++++++++++++++++++++++ +> 1 file changed, 32 insertions(+) +> +> diff --git a/test/T190-multipart.sh b/test/T190-multipart.sh +> index 85cbf67..26f7c7a 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,12 @@ 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" + +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 + +Then you'd remove test_subtest_known_broken when you add the feature. + +> +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)" + +I think I'd like to see a subtest for searching +mimetype:multipart/alternative (which should *not* find the message, +IIUC). + +BR, +Jani. + +> + +> + +> test_done +> -- +> 1.9.1 +> +> _______________________________________________ +> notmuch mailing list +> notmuch@notmuchmail.org +> http://notmuchmail.org/mailman/listinfo/notmuch