From: Jani Nikula Date: Thu, 15 Jan 2015 17:19:04 +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=3b894bf87db0acc38b739a7d3cf9588dbe19139a;p=notmuch-archives.git Re: [PATCH v2 1/5] Add a failing unit test for indexed mime types --- diff --git a/3e/9f8e1016a9d1679fad4f4ae367a451b20cefb3 b/3e/9f8e1016a9d1679fad4f4ae367a451b20cefb3 new file mode 100644 index 000000000..d18329634 --- /dev/null +++ b/3e/9f8e1016a9d1679fad4f4ae367a451b20cefb3 @@ -0,0 +1,153 @@ +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 0D576431FDB + for ; Thu, 15 Jan 2015 09:18:59 -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 EjnRN3RAqeQu for ; + Thu, 15 Jan 2015 09:18:55 -0800 (PST) +Received: from mail-we0-f181.google.com (mail-we0-f181.google.com + [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 99C57431FD9 + for ; Thu, 15 Jan 2015 09:18:55 -0800 (PST) +Received: by mail-we0-f181.google.com with SMTP id q58so15968587wes.12 + for ; Thu, 15 Jan 2015 09:18:53 -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=w5nhOLEmClk67Lt3QUw1LOY8PGsneu7qNmtoGKuaYWM=; + b=GdIO86/4fzCTFZQelroPauqtAdkZWgYNQU3JuvfcsVk2e0d6xQ/bYK3yAQbZpiUbNl + DPoH8sXIyTtmionccMqZABmGKLsfsk1xjCFAZdlVs9Zd8bB3EPNs8h5mRJB3ISuB8Cv6 + Es0H0bQT9NRpMw1QUnbHAAb7Sol2F4CKWc+Y6dVXJBqh0SMnJUwvN5UwHvIdRtnohvJc + I1ffiGiEkD2NU2gPc2NDwYWbvkr4MO3BJPna3b//MeABrUBBeM1P/lS+9aZxLHkxN6zu + Q9N3IhH/LbB43oI9AOPanTW1TaZIUKfMuWk+wcD2Jrgvd9Ewqd8io9ikT2oXpyccKhfH + h64A== +X-Gm-Message-State: + ALoCoQl7q1MPK6Dej9RrZSFSHvLamM2mxVvVeHFsXMtmgfXuwkC0TH4VGNd5uim6HqQDfesyfhPE +X-Received: by 10.181.29.198 with SMTP id jy6mr28475702wid.0.1421342333220; + Thu, 15 Jan 2015 09:18:53 -0800 (PST) +Received: from localhost (mobile-internet-bcee14-89.dhcp.inet.fi. + [188.238.20.89]) + by mx.google.com with ESMTPSA id h8sm8267860wiy.4.2015.01.15.09.18.52 + (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); + Thu, 15 Jan 2015 09:18:52 -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: <87a91k9dj3.fsf@nikula.org> +References: <1421193628-2699-1-git-send-email-todd@electricoding.com> + <1421193628-2699-2-git-send-email-todd@electricoding.com> + <87a91k9dj3.fsf@nikula.org> +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:19:04 +0200 +Message-ID: <871tmw9d2v.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:18:59 -0000 + +On Thu, 15 Jan 2015, Jani Nikula wrote: +> 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). + +Looking at the code in patch 3, I think it will index that. Please add +the test so we know. ;) + +> +> BR, +> Jani. +> +>> + +>> + +>> test_done +>> -- +>> 1.9.1 +>> +>> _______________________________________________ +>> notmuch mailing list +>> notmuch@notmuchmail.org +>> http://notmuchmail.org/mailman/listinfo/notmuch