From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id A1A7E6DE18F8 for ; Sun, 26 Feb 2017 01:00:54 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.506 X-Spam-Level: X-Spam-Status: No, score=0.506 tagged_above=-999 required=5 tests=[AWL=-0.146, SPF_NEUTRAL=0.652] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RDsBg5lfxzmj for ; Sun, 26 Feb 2017 01:00:53 -0800 (PST) Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) by arlo.cworth.org (Postfix) with ESMTP id 612ED6DE18D8 for ; Sun, 26 Feb 2017 01:00:51 -0800 (PST) Received: from guru.guru-group.fi (localhost [IPv6:::1]) by guru.guru-group.fi (Postfix) with ESMTP id AEF0810005A for ; Sun, 26 Feb 2017 11:00:17 +0200 (EET) From: Tomi Ollila To: notmuch@notmuchmail.org Subject: Re: [PATCH 1/2] cli/show: list all filenames of a message in the formatted output In-Reply-To: <20170225133132.9976-1-jani@nikula.org> References: <20170225133132.9976-1-jani@nikula.org> User-Agent: Notmuch/0.23.5+113~gfa95df1 (https://notmuchmail.org) Emacs/24.5.1 (x86_64-unknown-linux-gnu) X-Face: HhBM'cA~ MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.22 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: Sun, 26 Feb 2017 09:00:54 -0000 On Sat, Feb 25 2017, Jani Nikula wrote: > Instead of just having the first filename for the message, list all > duplicate filenames of the message as a list in the formatted > outputs. This bumps the format version to 3. > > --- Looks good to me. Tests pass. Tomi > > v2: fix tests, and fix bugs found by the added tests :) > > I presume the UI could do fancy things with this to highlight messages > with dupes better. I haven't quite figured out yet what that could be, > but this seems like the right thing to do regardless. > --- > devel/schemata | 5 ++++- > notmuch-client.h | 2 +- > notmuch-show.c | 15 ++++++++++++++- > test/T070-insert.sh | 2 +- > test/T160-json.sh | 10 +++++----- > test/T170-sexp.sh | 10 +++++----- > test/T190-multipart.sh | 6 +++--- > test/T220-reply.sh | 2 +- > test/T340-maildir-sync.sh | 2 +- > test/T350-crypto.sh | 14 +++++++------- > test/T355-smime.sh | 2 +- > test/T470-missing-headers.sh | 4 ++-- > test/T510-thread-replies.sh | 22 +++++++++++----------- > test/test-lib.sh | 2 +- > 14 files changed, 57 insertions(+), 41 deletions(-) > > diff --git a/devel/schemata b/devel/schemata > index 41dc4a60fff3..6dede7a453d7 100644 > --- a/devel/schemata > +++ b/devel/schemata > @@ -26,6 +26,9 @@ v1 > v2 > - Added the thread_summary.query field. >=20=20 > +v3 > +- Replaced message.filename string with a list of filenames. > + > Common non-terminals > -------------------- >=20=20 > @@ -59,7 +62,7 @@ message =3D { > # (format_message_sprinter) > id: messageid, > match: bool, > - filename: string, > + filename: [string*], > timestamp: unix_time, # date header as unix time > date_relative: string, # user-friendly timestamp > tags: [string*], > diff --git a/notmuch-client.h b/notmuch-client.h > index d026e6004239..21b087980a17 100644 > --- a/notmuch-client.h > +++ b/notmuch-client.h > @@ -145,7 +145,7 @@ chomp_newline (char *str) > * this. New (required) map fields can be added without increasing > * this. > */ > -#define NOTMUCH_FORMAT_CUR 2 > +#define NOTMUCH_FORMAT_CUR 3 > /* The minimum supported structured output format version. Requests > * for format versions below this will return an error. */ > #define NOTMUCH_FORMAT_MIN 1 > diff --git a/notmuch-show.c b/notmuch-show.c > index 22fa655ad20d..ab4ea1c2bdc1 100644 > --- a/notmuch-show.c > +++ b/notmuch-show.c > @@ -133,7 +133,20 @@ format_message_sprinter (sprinter_t *sp, notmuch_mes= sage_t *message) > sp->boolean (sp, notmuch_message_get_flag (message, NOTMUCH_MESSAGE_= FLAG_EXCLUDED)); >=20=20 > sp->map_key (sp, "filename"); > - sp->string (sp, notmuch_message_get_filename (message)); > + if (notmuch_format_version >=3D 3) { > + notmuch_filenames_t *filenames; > + > + sp->begin_list (sp); > + for (filenames =3D notmuch_message_get_filenames (message); > + notmuch_filenames_valid (filenames); > + notmuch_filenames_move_to_next (filenames)) { > + sp->string (sp, notmuch_filenames_get (filenames)); > + } > + notmuch_filenames_destroy (filenames); > + sp->end (sp); > + } else { > + sp->string (sp, notmuch_message_get_filename (message)); > + } >=20=20 > sp->map_key (sp, "timestamp"); > date =3D notmuch_message_get_date (message); > diff --git a/test/T070-insert.sh b/test/T070-insert.sh > index 3dd76737c530..9120debabf8c 100755 > --- a/test/T070-insert.sh > +++ b/test/T070-insert.sh > @@ -43,7 +43,7 @@ expected=3D'[[[{ > "id": "'"${gen_msg_id}"'", > "match": true, > "excluded": false, > - "filename": "'"${cur_msg_filename}"'", > + "filename": ["'"${cur_msg_filename}"'"], > "timestamp": 946728000, > "date_relative": "2000-01-01", > "tags": ["inbox","unread"], > diff --git a/test/T160-json.sh b/test/T160-json.sh > index b346f37ee471..099632b4a286 100755 > --- a/test/T160-json.sh > +++ b/test/T160-json.sh > @@ -5,16 +5,16 @@ test_description=3D"--format=3Djson output" > test_begin_subtest "Show message: json" > add_message "[subject]=3D\"json-show-subject\"" "[date]=3D\"Sat, 01 Jan = 2000 12:00:00 -0000\"" "[bcc]=3D\"test_suite+bcc@notmuchmail.org\"" "[reply= -to]=3D\"test_suite+replyto@notmuchmail.org\"" "[body]=3D\"json-show-messag= e\"" > output=3D$(notmuch show --format=3Djson "json-show-message") > -test_expect_equal_json "$output" "[[[{\"id\": \"${gen_msg_id}\", \"match= \": true, \"excluded\": false, \"filename\": \"${gen_msg_filename}\", \"tim= estamp\": 946728000, \"date_relative\": \"2000-01-01\", \"tags\": [\"inbox\= ",\"unread\"], \"headers\": {\"Subject\": \"json-show-subject\", \"From\": = \"Notmuch Test Suite \", \"To\": \"Notmuch Test= Suite \", \"Bcc\": \"test_suite+bcc@notmuchmai= l.org\", \"Reply-To\": \"test_suite+replyto@notmuchmail.org\", \"Date\": \"= Sat, 01 Jan 2000 12:00:00 +0000\"}, \"body\": [{\"id\": 1, \"content-type\"= : \"text/plain\", \"content\": \"json-show-message\n\"}]}, []]]]" > +test_expect_equal_json "$output" "[[[{\"id\": \"${gen_msg_id}\", \"match= \": true, \"excluded\": false, \"filename\": [\"${gen_msg_filename}\"], \"t= imestamp\": 946728000, \"date_relative\": \"2000-01-01\", \"tags\": [\"inbo= x\",\"unread\"], \"headers\": {\"Subject\": \"json-show-subject\", \"From\"= : \"Notmuch Test Suite \", \"To\": \"Notmuch Te= st Suite \", \"Bcc\": \"test_suite+bcc@notmuchm= ail.org\", \"Reply-To\": \"test_suite+replyto@notmuchmail.org\", \"Date\": = \"Sat, 01 Jan 2000 12:00:00 +0000\"}, \"body\": [{\"id\": 1, \"content-type= \": \"text/plain\", \"content\": \"json-show-message\n\"}]}, []]]]" >=20=20 > # This should be the same output as above. > test_begin_subtest "Show message: json --body=3Dtrue" > output=3D$(notmuch show --format=3Djson --body=3Dtrue "json-show-message= ") > -test_expect_equal_json "$output" "[[[{\"id\": \"${gen_msg_id}\", \"match= \": true, \"excluded\": false, \"filename\": \"${gen_msg_filename}\", \"tim= estamp\": 946728000, \"date_relative\": \"2000-01-01\", \"tags\": [\"inbox\= ",\"unread\"], \"headers\": {\"Subject\": \"json-show-subject\", \"From\": = \"Notmuch Test Suite \", \"To\": \"Notmuch Test= Suite \", \"Bcc\": \"test_suite+bcc@notmuchmai= l.org\", \"Reply-To\": \"test_suite+replyto@notmuchmail.org\", \"Date\": \"= Sat, 01 Jan 2000 12:00:00 +0000\"}, \"body\": [{\"id\": 1, \"content-type\"= : \"text/plain\", \"content\": \"json-show-message\n\"}]}, []]]]" > +test_expect_equal_json "$output" "[[[{\"id\": \"${gen_msg_id}\", \"match= \": true, \"excluded\": false, \"filename\": [\"${gen_msg_filename}\"], \"t= imestamp\": 946728000, \"date_relative\": \"2000-01-01\", \"tags\": [\"inbo= x\",\"unread\"], \"headers\": {\"Subject\": \"json-show-subject\", \"From\"= : \"Notmuch Test Suite \", \"To\": \"Notmuch Te= st Suite \", \"Bcc\": \"test_suite+bcc@notmuchm= ail.org\", \"Reply-To\": \"test_suite+replyto@notmuchmail.org\", \"Date\": = \"Sat, 01 Jan 2000 12:00:00 +0000\"}, \"body\": [{\"id\": 1, \"content-type= \": \"text/plain\", \"content\": \"json-show-message\n\"}]}, []]]]" >=20=20 > test_begin_subtest "Show message: json --body=3Dfalse" > output=3D$(notmuch show --format=3Djson --body=3Dfalse "json-show-messag= e") > -test_expect_equal_json "$output" "[[[{\"id\": \"${gen_msg_id}\", \"match= \": true, \"excluded\": false, \"filename\": \"${gen_msg_filename}\", \"tim= estamp\": 946728000, \"date_relative\": \"2000-01-01\", \"tags\": [\"inbox\= ",\"unread\"], \"headers\": {\"Subject\": \"json-show-subject\", \"From\": = \"Notmuch Test Suite \", \"To\": \"Notmuch Test= Suite \", \"Bcc\": \"test_suite+bcc@notmuchmai= l.org\", \"Reply-To\": \"test_suite+replyto@notmuchmail.org\", \"Date\": \"= Sat, 01 Jan 2000 12:00:00 +0000\"}}, []]]]" > +test_expect_equal_json "$output" "[[[{\"id\": \"${gen_msg_id}\", \"match= \": true, \"excluded\": false, \"filename\": [\"${gen_msg_filename}\"], \"t= imestamp\": 946728000, \"date_relative\": \"2000-01-01\", \"tags\": [\"inbo= x\",\"unread\"], \"headers\": {\"Subject\": \"json-show-subject\", \"From\"= : \"Notmuch Test Suite \", \"To\": \"Notmuch Te= st Suite \", \"Bcc\": \"test_suite+bcc@notmuchm= ail.org\", \"Reply-To\": \"test_suite+replyto@notmuchmail.org\", \"Date\": = \"Sat, 01 Jan 2000 12:00:00 +0000\"}}, []]]]" >=20=20 > test_begin_subtest "Search message: json" > add_message "[subject]=3D\"json-search-subject\"" "[date]=3D\"Sat, 01 Ja= n 2000 12:00:00 -0000\"" "[body]=3D\"json-search-message\"" > @@ -33,7 +33,7 @@ test_expect_equal_json "$output" "[{\"thread\": \"XXX\", > test_begin_subtest "Show message: json, utf-8" > add_message "[subject]=3D\"json-show-utf8-body-s=C3=BCbj=C3=A9ct\"" "[da= te]=3D\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=3D\"js=C3=B6n-show-m=C3= =A9ssage\"" > output=3D$(notmuch show --format=3Djson "js=C3=B6n-show-m=C3=A9ssage") > -test_expect_equal_json "$output" "[[[{\"id\": \"${gen_msg_id}\", \"match= \": true, \"excluded\": false, \"filename\": \"${gen_msg_filename}\", \"tim= estamp\": 946728000, \"date_relative\": \"2000-01-01\", \"tags\": [\"inbox\= ",\"unread\"], \"headers\": {\"Subject\": \"json-show-utf8-body-s=C3=BCbj= =C3=A9ct\", \"From\": \"Notmuch Test Suite \", = \"To\": \"Notmuch Test Suite \", \"Date\": \"Sa= t, 01 Jan 2000 12:00:00 +0000\"}, \"body\": [{\"id\": 1, \"content-type\": = \"text/plain\", \"content\": \"js=C3=B6n-show-m=C3=A9ssage\n\"}]}, []]]]" > +test_expect_equal_json "$output" "[[[{\"id\": \"${gen_msg_id}\", \"match= \": true, \"excluded\": false, \"filename\": [\"${gen_msg_filename}\"], \"t= imestamp\": 946728000, \"date_relative\": \"2000-01-01\", \"tags\": [\"inbo= x\",\"unread\"], \"headers\": {\"Subject\": \"json-show-utf8-body-s=C3=BCbj= =C3=A9ct\", \"From\": \"Notmuch Test Suite \", = \"To\": \"Notmuch Test Suite \", \"Date\": \"Sa= t, 01 Jan 2000 12:00:00 +0000\"}, \"body\": [{\"id\": 1, \"content-type\": = \"text/plain\", \"content\": \"js=C3=B6n-show-m=C3=A9ssage\n\"}]}, []]]]" >=20=20 > test_begin_subtest "Show message: json, inline attachment filename" > subject=3D'json-show-inline-attachment-filename' > @@ -48,7 +48,7 @@ output=3D$(notmuch show --format=3Djson "id:$id") > filename=3D$(notmuch search --output=3Dfiles "id:$id") > # Get length of README after base64-encoding, minus additional newline. > attachment_length=3D$(( $(base64 $TEST_DIRECTORY/README | wc -c) - 1 )) > -test_expect_equal_json "$output" "[[[{\"id\": \"$id\", \"match\": true, = \"excluded\": false, \"filename\": \"$filename\", \"timestamp\": 946728000,= \"date_relative\": \"2000-01-01\", \"tags\": [\"inbox\"], \"headers\": {\"= Subject\": \"$subject\", \"From\": \"Notmuch Test Suite \", \"To\": \"test_suite@notmuchmail.org\", \"Date\": \"Sat, 01 Ja= n 2000 12:00:00 +0000\"}, \"body\": [{\"id\": 1, \"content-type\": \"multip= art/mixed\", \"content\": [{\"id\": 2, \"content-type\": \"text/plain\", \"= content\": \"This is a test message with inline attachment with a filename\= "}, {\"id\": 3, \"content-type\": \"application/octet-stream\", \"content-l= ength\": $attachment_length, \"content-transfer-encoding\": \"base64\", \"f= ilename\": \"README\"}]}]}, []]]]" > +test_expect_equal_json "$output" "[[[{\"id\": \"$id\", \"match\": true, = \"excluded\": false, \"filename\": [\"$filename\"], \"timestamp\": 94672800= 0, \"date_relative\": \"2000-01-01\", \"tags\": [\"inbox\"], \"headers\": {= \"Subject\": \"$subject\", \"From\": \"Notmuch Test Suite \", \"To\": \"test_suite@notmuchmail.org\", \"Date\": \"Sat, 01 = Jan 2000 12:00:00 +0000\"}, \"body\": [{\"id\": 1, \"content-type\": \"mult= ipart/mixed\", \"content\": [{\"id\": 2, \"content-type\": \"text/plain\", = \"content\": \"This is a test message with inline attachment with a filenam= e\"}, {\"id\": 3, \"content-type\": \"application/octet-stream\", \"content= -length\": $attachment_length, \"content-transfer-encoding\": \"base64\", \= "filename\": \"README\"}]}]}, []]]]" >=20=20 > test_begin_subtest "Search message: json, utf-8" > add_message "[subject]=3D\"json-search-utf8-body-s=C3=BCbj=C3=A9ct\"" "[= date]=3D\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=3D\"js=C3=B6n-search-m= =C3=A9ssage\"" > diff --git a/test/T170-sexp.sh b/test/T170-sexp.sh > index 800ebc6310e7..07113c0ad9a2 100755 > --- a/test/T170-sexp.sh > +++ b/test/T170-sexp.sh > @@ -5,16 +5,16 @@ test_description=3D"--format=3Dsexp output" > test_begin_subtest "Show message: sexp" > add_message "[subject]=3D\"sexp-show-subject\"" "[date]=3D\"Sat, 01 Jan = 2000 12:00:00 -0000\"" "[bcc]=3D\"test_suite+bcc@notmuchmail.org\"" "[reply= -to]=3D\"test_suite+replyto@notmuchmail.org\"" "[body]=3D\"sexp-show-messag= e\"" > output=3D$(notmuch show --format=3Dsexp "sexp-show-message") > -test_expect_equal "$output" "((((:id \"${gen_msg_id}\" :match t :exclude= d nil :filename \"${gen_msg_filename}\" :timestamp 946728000 :date_relative= \"2000-01-01\" :tags (\"inbox\" \"unread\") :headers (:Subject \"sexp-show= -subject\" :From \"Notmuch Test Suite \" :To \"= Notmuch Test Suite \" :Bcc \"test_suite+bcc@not= muchmail.org\" :Reply-To \"test_suite+replyto@notmuchmail.org\" :Date \"Sat= , 01 Jan 2000 12:00:00 +0000\") :body ((:id 1 :content-type \"text/plain\" = :content \"sexp-show-message\n\"))) ())))" > +test_expect_equal "$output" "((((:id \"${gen_msg_id}\" :match t :exclude= d nil :filename (\"${gen_msg_filename}\") :timestamp 946728000 :date_relati= ve \"2000-01-01\" :tags (\"inbox\" \"unread\") :headers (:Subject \"sexp-sh= ow-subject\" :From \"Notmuch Test Suite \" :To = \"Notmuch Test Suite \" :Bcc \"test_suite+bcc@n= otmuchmail.org\" :Reply-To \"test_suite+replyto@notmuchmail.org\" :Date \"S= at, 01 Jan 2000 12:00:00 +0000\") :body ((:id 1 :content-type \"text/plain\= " :content \"sexp-show-message\n\"))) ())))" >=20=20 > # This should be the same output as above. > test_begin_subtest "Show message: sexp --body=3Dtrue" > output=3D$(notmuch show --format=3Dsexp --body=3Dtrue "sexp-show-message= ") > -test_expect_equal "$output" "((((:id \"${gen_msg_id}\" :match t :exclude= d nil :filename \"${gen_msg_filename}\" :timestamp 946728000 :date_relative= \"2000-01-01\" :tags (\"inbox\" \"unread\") :headers (:Subject \"sexp-show= -subject\" :From \"Notmuch Test Suite \" :To \"= Notmuch Test Suite \" :Bcc \"test_suite+bcc@not= muchmail.org\" :Reply-To \"test_suite+replyto@notmuchmail.org\" :Date \"Sat= , 01 Jan 2000 12:00:00 +0000\") :body ((:id 1 :content-type \"text/plain\" = :content \"sexp-show-message\n\"))) ())))" > +test_expect_equal "$output" "((((:id \"${gen_msg_id}\" :match t :exclude= d nil :filename (\"${gen_msg_filename}\") :timestamp 946728000 :date_relati= ve \"2000-01-01\" :tags (\"inbox\" \"unread\") :headers (:Subject \"sexp-sh= ow-subject\" :From \"Notmuch Test Suite \" :To = \"Notmuch Test Suite \" :Bcc \"test_suite+bcc@n= otmuchmail.org\" :Reply-To \"test_suite+replyto@notmuchmail.org\" :Date \"S= at, 01 Jan 2000 12:00:00 +0000\") :body ((:id 1 :content-type \"text/plain\= " :content \"sexp-show-message\n\"))) ())))" >=20=20 > test_begin_subtest "Show message: sexp --body=3Dfalse" > output=3D$(notmuch show --format=3Dsexp --body=3Dfalse "sexp-show-messag= e") > -test_expect_equal "$output" "((((:id \"${gen_msg_id}\" :match t :exclude= d nil :filename \"${gen_msg_filename}\" :timestamp 946728000 :date_relative= \"2000-01-01\" :tags (\"inbox\" \"unread\") :headers (:Subject \"sexp-show= -subject\" :From \"Notmuch Test Suite \" :To \"= Notmuch Test Suite \" :Bcc \"test_suite+bcc@not= muchmail.org\" :Reply-To \"test_suite+replyto@notmuchmail.org\" :Date \"Sat= , 01 Jan 2000 12:00:00 +0000\")) ())))" > +test_expect_equal "$output" "((((:id \"${gen_msg_id}\" :match t :exclude= d nil :filename (\"${gen_msg_filename}\") :timestamp 946728000 :date_relati= ve \"2000-01-01\" :tags (\"inbox\" \"unread\") :headers (:Subject \"sexp-sh= ow-subject\" :From \"Notmuch Test Suite \" :To = \"Notmuch Test Suite \" :Bcc \"test_suite+bcc@n= otmuchmail.org\" :Reply-To \"test_suite+replyto@notmuchmail.org\" :Date \"S= at, 01 Jan 2000 12:00:00 +0000\")) ())))" >=20=20 > test_begin_subtest "Search message: sexp" > add_message "[subject]=3D\"sexp-search-subject\"" "[date]=3D\"Sat, 01 Ja= n 2000 12:00:00 -0000\"" "[body]=3D\"sexp-search-message\"" > @@ -24,7 +24,7 @@ test_expect_equal "$output" "((:thread \"00000000000000= 02\" :timestamp 946728000 > test_begin_subtest "Show message: sexp, utf-8" > add_message "[subject]=3D\"sexp-show-utf8-body-s=C3=BCbj=C3=A9ct\"" "[da= te]=3D\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=3D\"js=C3=B6n-show-m=C3= =A9ssage\"" > output=3D$(notmuch show --format=3Dsexp "js=C3=B6n-show-m=C3=A9ssage") > -test_expect_equal "$output" "((((:id \"${gen_msg_id}\" :match t :exclude= d nil :filename \"${gen_msg_filename}\" :timestamp 946728000 :date_relative= \"2000-01-01\" :tags (\"inbox\" \"unread\") :headers (:Subject \"sexp-show= -utf8-body-s=C3=BCbj=C3=A9ct\" :From \"Notmuch Test Suite \" :To \"Notmuch Test Suite \" :Date= \"Sat, 01 Jan 2000 12:00:00 +0000\") :body ((:id 1 :content-type \"text/pl= ain\" :content \"js=C3=B6n-show-m=C3=A9ssage\n\"))) ())))" > +test_expect_equal "$output" "((((:id \"${gen_msg_id}\" :match t :exclude= d nil :filename (\"${gen_msg_filename}\") :timestamp 946728000 :date_relati= ve \"2000-01-01\" :tags (\"inbox\" \"unread\") :headers (:Subject \"sexp-sh= ow-utf8-body-s=C3=BCbj=C3=A9ct\" :From \"Notmuch Test Suite \" :To \"Notmuch Test Suite \" :Da= te \"Sat, 01 Jan 2000 12:00:00 +0000\") :body ((:id 1 :content-type \"text/= plain\" :content \"js=C3=B6n-show-m=C3=A9ssage\n\"))) ())))" >=20=20 > test_begin_subtest "Show message: sexp, inline attachment filename" > subject=3D'sexp-show-inline-attachment-filename' > @@ -39,7 +39,7 @@ output=3D$(notmuch show --format=3Dsexp "id:$id") > filename=3D$(notmuch search --output=3Dfiles "id:$id") > # Get length of README after base64-encoding, minus additional newline. > attachment_length=3D$(( $(base64 $TEST_DIRECTORY/README | wc -c) - 1 )) > -test_expect_equal "$output" "((((:id \"$id\" :match t :excluded nil :fil= ename \"$filename\" :timestamp 946728000 :date_relative \"2000-01-01\" :tag= s (\"inbox\") :headers (:Subject \"sexp-show-inline-attachment-filename\" := >From \"Notmuch Test Suite \" :To \"test_suite@n= otmuchmail.org\" :Date \"Sat, 01 Jan 2000 12:00:00 +0000\") :body ((:id 1 := content-type \"multipart/mixed\" :content ((:id 2 :content-type \"text/plai= n\" :content \"This is a test message with inline attachment with a filenam= e\") (:id 3 :content-type \"application/octet-stream\" :filename \"README\"= :content-transfer-encoding \"base64\" :content-length $attachment_length))= ))) ())))" > +test_expect_equal "$output" "((((:id \"$id\" :match t :excluded nil :fil= ename (\"$filename\") :timestamp 946728000 :date_relative \"2000-01-01\" :t= ags (\"inbox\") :headers (:Subject \"sexp-show-inline-attachment-filename\"= :From \"Notmuch Test Suite \" :To \"test_suite= @notmuchmail.org\" :Date \"Sat, 01 Jan 2000 12:00:00 +0000\") :body ((:id 1= :content-type \"multipart/mixed\" :content ((:id 2 :content-type \"text/pl= ain\" :content \"This is a test message with inline attachment with a filen= ame\") (:id 3 :content-type \"application/octet-stream\" :filename \"README= \" :content-transfer-encoding \"base64\" :content-length $attachment_length= ))))) ())))" >=20=20 > test_begin_subtest "Search message: sexp, utf-8" > add_message "[subject]=3D\"sexp-search-utf8-body-s=C3=BCbj=C3=A9ct\"" "[= date]=3D\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=3D\"js=C3=B6n-search-m= =C3=A9ssage\"" > diff --git a/test/T190-multipart.sh b/test/T190-multipart.sh > index 35678909b0ce..18eb7b839ac0 100755 > --- a/test/T190-multipart.sh > +++ b/test/T190-multipart.sh > @@ -345,7 +345,7 @@ test_expect_success \ > test_begin_subtest "--format=3Djson --part=3D0, full message" > notmuch show --format=3Djson --part=3D0 'id:87liy5ap00.fsf@yoom.home.cwo= rth.org' >OUTPUT > cat <EXPECTED > -{"id": "87liy5ap00.fsf@yoom.home.cworth.org", "match": true, "excluded":= false, "filename": "${MAIL_DIR}/multipart", "timestamp": 978709437, "date_= relative": "2001-01-05", "tags": ["attachment","inbox","signed","unread"], = "headers": {"Subject": "Multipart message", "From": "Carl Worth ", "To": "cworth@cworth.org", "Date": "Fri, 05 Jan 2001 15:43:57 +0= 000"}, "body": [ > +{"id": "87liy5ap00.fsf@yoom.home.cworth.org", "match": true, "excluded":= false, "filename": ["${MAIL_DIR}/multipart"], "timestamp": 978709437, "dat= e_relative": "2001-01-05", "tags": ["attachment","inbox","signed","unread"]= , "headers": {"Subject": "Multipart message", "From": "Carl Worth ", "To": "cworth@cworth.org", "Date": "Fri, 05 Jan 2001 15:43:57 = +0000"}, "body": [ > {"id": 1, "content-type": "multipart/signed", "content": [ > {"id": 2, "content-type": "multipart/mixed", "content": [ > {"id": 3, "content-type": "message/rfc822", "content": [{"headers": {"Su= bject": "html message", "From": "Carl Worth ", "To": "cw= orth@cworth.org", "Date": "Fri, 05 Jan 2001 15:42:57 +0000"}, "body": [ > @@ -627,7 +627,7 @@ notmuch_json_show_sanitize <EXPECTED > "original": {"id": "XXXXX", > "match": false, > "excluded": false, > - "filename": "YYYYY", > + "filename": ["YYYYY"], > "timestamp": 978709437, > "date_relative": "2001-01-05", > "tags": ["attachment","inbox","signed","unread"], > @@ -715,7 +715,7 @@ cat_expected_head () > cat < [[[{"id": "htmlmessage", "match":true, "excluded": false, "date_relative= ":"2000-01-01", > "timestamp": 946684800, > - "filename": "${MAIL_DIR}/include-html", > + "filename": ["${MAIL_DIR}/include-html"], > "tags": ["inbox", "unread"], > "headers": { "Date": "Sat, 01 Jan 2000 00:00:00 +0000", "From": "A ", > "Subject": "html message", "To": "B "}, > diff --git a/test/T220-reply.sh b/test/T220-reply.sh > index 818a86541496..17741e0d7a85 100755 > --- a/test/T220-reply.sh > +++ b/test/T220-reply.sh > @@ -229,7 +229,7 @@ test_expect_equal_json "$output" ' > ], > "date_relative": "2010-01-05", > "excluded": false, > - "filename": "'${MAIL_DIR}'/msg-012", > + "filename": ["'${MAIL_DIR}'/msg-012"], > "headers": { > "Date": "Tue, 05 Jan 2010 15:43:56 +0000", > "From": "\u2603 ", > diff --git a/test/T340-maildir-sync.sh b/test/T340-maildir-sync.sh > index efeaa3f60d6e..b474bf46e4be 100755 > --- a/test/T340-maildir-sync.sh > +++ b/test/T340-maildir-sync.sh > @@ -39,7 +39,7 @@ output=3D$(notmuch show --format=3Djson id:${gen_msg_id= } | notmuch_json_show_sanitiz > test_expect_equal_json "$output" '[[[{"id": "XXXXX", > "match": true, > "excluded": false, > -"filename": "YYYYY", > +"filename": ["YYYYY"], > "timestamp": 42, > "date_relative": "2001-01-05", > "tags": ["inbox","replied"], > diff --git a/test/T350-crypto.sh b/test/T350-crypto.sh > index a1e5e206081f..14b215a3c0a6 100755 > --- a/test/T350-crypto.sh > +++ b/test/T350-crypto.sh > @@ -41,7 +41,7 @@ output=3D$(notmuch show --format=3Djson --verify subjec= t:"test signed message 001" \ > expected=3D'[[[{"id": "XXXXX", > "match": true, > "excluded": false, > - "filename": "YYYYY", > + "filename": ["YYYYY"], > "timestamp": 946728000, > "date_relative": "2000-01-01", > "tags": ["inbox","signed"], > @@ -75,7 +75,7 @@ output=3D$(notmuch show --format=3Djson --verify subjec= t:"test signed message 001" \ > expected=3D'[[[{"id": "XXXXX", > "match": true, > "excluded": false, > - "filename": "YYYYY", > + "filename": ["YYYYY"], > "timestamp": 946728000, > "date_relative": "2000-01-01", > "tags": ["inbox","signed"], > @@ -109,7 +109,7 @@ output=3D$(notmuch show --format=3Djson --verify subj= ect:"test signed message 001" \ > expected=3D'[[[{"id": "XXXXX", > "match": true, > "excluded": false, > - "filename": "YYYYY", > + "filename": ["YYYYY"], > "timestamp": 946728000, > "date_relative": "2000-01-01", > "tags": ["inbox","signed"], > @@ -183,7 +183,7 @@ output=3D$(notmuch show --format=3Djson --decrypt sub= ject:"test encrypted message 00 > expected=3D'[[[{"id": "XXXXX", > "match": true, > "excluded": false, > - "filename": "YYYYY", > + "filename": ["YYYYY"], > "timestamp": 946728000, > "date_relative": "2000-01-01", > "tags": ["encrypted","inbox"], > @@ -240,7 +240,7 @@ output=3D$(notmuch show --format=3Djson --decrypt sub= ject:"test encrypted message 00 > expected=3D'[[[{"id": "XXXXX", > "match": true, > "excluded": false, > - "filename": "YYYYY", > + "filename": ["YYYYY"], > "timestamp": 946728000, > "date_relative": "2000-01-01", > "tags": ["encrypted","inbox"], > @@ -276,7 +276,7 @@ output=3D$(notmuch show --format=3Djson --decrypt sub= ject:"test encrypted message 00 > expected=3D'[[[{"id": "XXXXX", > "match": true, > "excluded": false, > - "filename": "YYYYY", > + "filename": ["YYYYY"], > "timestamp": 946728000, > "date_relative": "2000-01-01", > "tags": ["encrypted","inbox"], > @@ -350,7 +350,7 @@ output=3D$(notmuch show --format=3Djson --verify subj= ect:"test signed message 001" \ > expected=3D'[[[{"id": "XXXXX", > "match": true, > "excluded": false, > - "filename": "YYYYY", > + "filename": ["YYYYY"], > "timestamp": 946728000, > "date_relative": "2000-01-01", > "tags": ["inbox","signed"], > diff --git a/test/T355-smime.sh b/test/T355-smime.sh > index a8be45e7098e..a6db4a18276f 100755 > --- a/test/T355-smime.sh > +++ b/test/T355-smime.sh > @@ -51,7 +51,7 @@ output=3D$(notmuch show --format=3Djson --verify subjec= t:"test signed message 001" \ > expected=3D'[[[{"id": "XXXXX", > "match": true, > "excluded": false, > - "filename": "YYYYY", > + "filename": ["YYYYY"], > "timestamp": 946728000, > "date_relative": "2000-01-01", > "tags": ["inbox","signed"], > diff --git a/test/T470-missing-headers.sh b/test/T470-missing-headers.sh > index 256a885f806a..32031e3174d3 100755 > --- a/test/T470-missing-headers.sh > +++ b/test/T470-missing-headers.sh > @@ -109,7 +109,7 @@ expected=3D$(notmuch_json_show_sanitize < ], > "date_relative": "2001-01-05", > "excluded": false, > - "filename": "YYYYY", > + "filename": ["YYYYY"], > "headers": { > "Date": "Fri, 05 Jan 2001 15:43:57 +0000", > "From": "", > @@ -139,7 +139,7 @@ expected=3D$(notmuch_json_show_sanitize < ], > "date_relative": "1970-01-01", > "excluded": false, > - "filename": "YYYYY", > + "filename": ["YYYYY"], > "headers": { > "Date": "Thu, 01 Jan 1970 00:00:00 +0000", > "From": "Notmuch Test Suite ", > diff --git a/test/T510-thread-replies.sh b/test/T510-thread-replies.sh > index 5ab066ac7baa..fa288bb19903 100755 > --- a/test/T510-thread-replies.sh > +++ b/test/T510-thread-replies.sh > @@ -21,7 +21,7 @@ output=3D$(notmuch show --format=3Djson 'subject:one' |= notmuch_json_show_sanitize) > expected=3D'[[[{"id": "foo@one.com", > "match": true, > "excluded": false, > - "filename": "YYYYY", > + "filename": ["YYYYY"], > "timestamp": 978709437, > "date_relative": "2001-01-05", > "tags": ["inbox", "unread"], > @@ -34,7 +34,7 @@ expected=3D'[[[{"id": "foo@one.com", > "content": "This is just a test message (#1)\n"}]}, > [[{"id": "msg-002@notmuch-test-suite", > "match": true, "excluded": false, > - "filename": "YYYYY", > + "filename": ["YYYYY"], > "timestamp": 978709437, "date_relative": "2001-01-05", > "tags": ["inbox", "unread"], "headers": {"Subject": "Re: one", > "From": "Notmuch Test Suite ", > @@ -54,7 +54,7 @@ add_message '[in-reply-to]=3D""' \ > output=3D$(notmuch show --format=3Djson 'subject:two' | notmuch_json_sho= w_sanitize) > expected=3D'[[[{"id": "foo@two.com", > "match": true, "excluded": false, > - "filename": "YYYYY", > + "filename": ["YYYYY"], > "timestamp": 978709437, "date_relative": "2001-01-05", "tags": ["inbox"= , "unread"], > "headers": {"Subject": "two", > "From": "Notmuch Test Suite ", > @@ -63,7 +63,7 @@ expected=3D'[[[{"id": "foo@two.com", > "body": [{"id": 1, "content-type": "text/plain", > "content": "This is just a test message (#3)\n"}]}, > [[{"id": "msg-004@notmuch-test-suite", "match": true, "excluded": false, > - "filename": "YYYYY", > + "filename": ["YYYYY"], > "timestamp": 978709437, "date_relative": "2001-01-05", "tags": ["inbox"= , "unread"], > "headers": {"Subject": "Re: two", > "From": "Notmuch Test Suite ", > @@ -82,7 +82,7 @@ add_message '[in-reply-to]=3D""' \ > '[subject]=3D"Re: three"' > output=3D$(notmuch show --format=3Djson 'subject:three' | notmuch_json_s= how_sanitize) > expected=3D'[[[{"id": "foo@three.com", "match": true, "excluded": false, > - "filename": "YYYYY", > + "filename": ["YYYYY"], > "timestamp": 978709437, "date_relative": "2001-01-05", "tags": ["inbox"= , "unread"], > "headers": {"Subject": "three", > "From": "Notmuch Test Suite ", > @@ -90,7 +90,7 @@ expected=3D'[[[{"id": "foo@three.com", "match": true, "= excluded": false, > "Date": "Fri, 05 Jan 2001 15:43:57 +0000"}, "body": [{"id": 1, > "content-type": "text/plain", "content": "This is just a test message (= #5)\n"}]}, > [[{"id": "msg-006@notmuch-test-suite", "match": true, "excluded": false, > - "filename": "YYYYY", > + "filename": ["YYYYY"], > "timestamp": 978709437, "date_relative": "2001-01-05", "tags": ["inbox"= , "unread"], > "headers": {"Subject": "Re: three", > "From": "Notmuch Test Suite ", > @@ -111,7 +111,7 @@ add_message '[in-reply-to]=3D""' \ > '[subject]=3D"neither"' > output=3D$(notmuch show --format=3Djson 'subject:four' | notmuch_json_sh= ow_sanitize) > expected=3D'[[[{"id": "foo@four.com", "match": true, "excluded": false, > - "filename": "YYYYY", > + "filename": ["YYYYY"], > "timestamp": 978709437, "date_relative": "2001-01-05", "tags": ["inbox"= , "unread"], > "headers": {"Subject": "four", > "From": "Notmuch Test Suite ", > @@ -119,7 +119,7 @@ expected=3D'[[[{"id": "foo@four.com", "match": true, = "excluded": false, > "Date": "Fri, 05 Jan 2001 15:43:57 +0000"}, "body": [{"id": 1, > "content-type": "text/plain", "content": "This is just a test message (= #7)\n"}]}, > [[{"id": "msg-009@notmuch-test-suite", "match": false, "excluded": fals= e, > - "filename": "YYYYY", > + "filename": ["YYYYY"], > "timestamp": 978709437, "date_relative": "2001-01-05", "tags": ["inbox"= , "unread"], > "headers": {"Subject": "neither", > "From": "Notmuch Test Suite ", > @@ -127,7 +127,7 @@ expected=3D'[[[{"id": "foo@four.com", "match": true, = "excluded": false, > "Date": "Fri, 05 Jan 2001 15:43:57 +0000"}, "body": [{"id": 1, > "content-type": "text/plain", "content": "This is just a test message (= #9)\n"}]}, > []]]]], [[{"id": "bar@four.com", "match": true, "excluded": false, > - "filename": "YYYYY", > + "filename": ["YYYYY"], > "timestamp": 978709437, "date_relative": "2001-01-05", "tags": ["inbox"= , "unread"], > "headers": {"Subject": "not-four", > "From": "Notmuch Test Suite ", > @@ -145,7 +145,7 @@ add_message '[id]=3D"bar@five.com"' \ > '[subject]=3D"not-five"' > output=3D$(notmuch show --format=3Djson 'subject:five' | notmuch_json_sh= ow_sanitize) > expected=3D'[[[{"id": "XXXXX", "match": true, "excluded": false, > - "filename": "YYYYY", "timestamp": 42, "date_relative": "2001-01-05", > + "filename": ["YYYYY"], "timestamp": 42, "date_relative": "2001-01-05", > "tags": ["inbox", "unread"], "headers": {"Subject": "five", > "From": "Notmuch Test Suite ", > "To": "Notmuch Test Suite ", > @@ -153,7 +153,7 @@ expected=3D'[[[{"id": "XXXXX", "match": true, "exclud= ed": false, > "content-type": "text/plain", > "content": "This is just a test message (#10)\n"}]}, > [[{"id": "XXXXX", "match": true, "excluded": false, > - "filename": "YYYYY", "timestamp": 42, "date_relative": "2001-01-05", > + "filename": ["YYYYY"], "timestamp": 42, "date_relative": "2001-01-05", > "tags": ["inbox", "unread"], > "headers": {"Subject": "not-five", > "From": "Notmuch Test Suite ", > diff --git a/test/test-lib.sh b/test/test-lib.sh > index bb32e97b2af7..d8e159437ca9 100644 > --- a/test/test-lib.sh > +++ b/test/test-lib.sh > @@ -745,7 +745,7 @@ notmuch_json_show_sanitize () > -e 's|"id": "[^"]*",|"id": "XXXXX",|g' \ > -e 's|"Date": "Fri, 05 Jan 2001 [^"]*0000"|"Date": "GENERATED_DATE"|g' \ > -e 's|"filename": "signature.asc",||g' \ > - -e 's|"filename": "/[^"]*",|"filename": "YYYYY",|g' \ > + -e 's|"filename": \["/[^"]*"\],|"filename": \["YYYYY"\],|g' \ > -e 's|"timestamp": 97.......|"timestamp": 42|g' \ > -e 's|"content-length": [1-9][0-9]*|"content-length": "NONZERO"|= g' > } > --=20 > 2.11.0 > > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > https://notmuchmail.org/mailman/listinfo/notmuch