]> git.notmuchmail.org Git - notmuch/commitdiff
test: normalize only message filenames in show json
authorPeter Wang <novalazy@gmail.com>
Sat, 15 Dec 2012 03:06:42 +0000 (14:06 +1100)
committerDavid Bremner <bremner@debian.org>
Mon, 17 Dec 2012 13:08:04 +0000 (09:08 -0400)
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
test/test-lib.sh

index 0527f848cf234a8e650e53903cfca9391d2e9411..344ed81a3c465cedc8cbd9fa545cd885986f75b8 100755 (executable)
@@ -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",
index fd64736bec562ede98be40ecda5ed3eab5e021f0..6ce3b3189f25c354b471c42db1730ab8fe172e89 100644 (file)
@@ -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