[PATCH v2 1/5] Add a failing unit test for indexed mime types
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 at example.com >> +Subject: odd content types >> +Date: Mon, 12 Jan 2014 18:12:32 + >> +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 at notmuchmail.org >> http://notmuchmail.org/mailman/listinfo/notmuch
[PATCH v2 1/5] Add a failing unit test for indexed mime types
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 at example.com > +Subject: odd content types > +Date: Mon, 12 Jan 2014 18:12:32 + > +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 at notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch
Re: [PATCH v2 1/5] Add a failing unit test for indexed mime types
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: t...@example.com >> +Subject: odd content types >> +Date: Mon, 12 Jan 2014 18:12:32 + >> +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 ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch
Re: [PATCH v2 1/5] Add a failing unit test for indexed mime types
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: t...@example.com > +Subject: odd content types > +Date: Mon, 12 Jan 2014 18:12:32 + > +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 ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch
[PATCH v2 1/5] Add a failing unit test for indexed mime types
--- 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 at example.com +Subject: odd content types +Date: Mon, 12 Jan 2014 18:12:32 + +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" +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)" + +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_done -- 1.9.1
[PATCH v2 1/5] Add a failing unit test for indexed mime types
--- 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: t...@example.com +Subject: odd content types +Date: Mon, 12 Jan 2014 18:12:32 + +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" +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)" + +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_done -- 1.9.1 ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch