unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Peter Wang <novalazy@gmail.com>
To: notmuch@notmuchmail.org
Subject: [PATCH v5 1/4] test: normalize only message filenames in show json
Date: Sat, 15 Dec 2012 14:06:42 +1100	[thread overview]
Message-ID: <1355540805-24937-2-git-send-email-novalazy@gmail.com> (raw)
In-Reply-To: <1355540805-24937-1-git-send-email-novalazy@gmail.com>

notmuch_json_show_sanitize replaced "filename" field values even in part
structures, where the value is predictable.  Make it only normalize the
filename value if it is an absolute path (begins with slash), which is
true of the Maildir filenames that were intended to be normalized away.
---
 test/multipart   | 2 +-
 test/test-lib.sh | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/test/multipart b/test/multipart
index 0527f84..344ed81 100755
--- a/test/multipart
+++ b/test/multipart
@@ -630,7 +630,7 @@ cat <<EOF >EXPECTED
  "content": "This is an embedded message, with a multipart/alternative part.\n"}]}]}]},
  {"id": 7,
  "content-type": "text/plain",
- "filename": "YYYYY",
+ "filename": "attachment",
  "content": "This is a text attachment.\n"},
  {"id": 8,
  "content-type": "text/plain",
diff --git a/test/test-lib.sh b/test/test-lib.sh
index fd64736..6ce3b31 100644
--- a/test/test-lib.sh
+++ b/test/test-lib.sh
@@ -600,7 +600,7 @@ notmuch_json_show_sanitize ()
 {
     sed \
 	-e 's|"id": "[^"]*",|"id": "XXXXX",|g' \
-	-e 's|"filename": "[^"]*",|"filename": "YYYYY",|g'
+	-e 's|"filename": "/[^"]*",|"filename": "YYYYY",|g'
 }
 
 # End of notmuch helper functions
-- 
1.7.12.1

  reply	other threads:[~2012-12-15  3:07 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-15  3:06 [PATCH v5 0/4] indicate length of omitted body content Peter Wang
2012-12-15  3:06 ` Peter Wang [this message]
2012-12-15  3:06 ` [PATCH v5 2/4] show: indicate charset for all omitted parts Peter Wang
2012-12-15 23:22   ` [PATCH v5b] " Peter Wang
2012-12-15  3:06 ` [PATCH v5 3/4] show: indicate length, encoding of omitted body content Peter Wang
2012-12-15 23:24   ` [PATCH v5b] " Peter Wang
2012-12-15  3:06 ` [PATCH v5 4/4] test: conform to content length, encoding fields Peter Wang
2012-12-15  8:45 ` [PATCH v5 0/4] indicate length of omitted body content Mark Walters
2012-12-15 11:04   ` Peter Wang
2012-12-15 12:53     ` David Bremner
2012-12-15 17:02       ` Tomi Ollila
2012-12-16  8:03       ` Mark Walters
2012-12-17 13:15 ` David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1355540805-24937-2-git-send-email-novalazy@gmail.com \
    --to=novalazy@gmail.com \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).