aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Peter Wang <novalazy@gmail.com>2012-12-15 14:06:42 +1100
committerGravatar David Bremner <bremner@debian.org>2012-12-17 09:08:04 -0400
commitee425ae2ad8605a1c57ba2f71562db9f060d2cea (patch)
treebc76839f76c3516a4de59053ec7831e28aa44bf7
parent2cdb3f54f71e5e415a930aaa36452ffe1db04d06 (diff)
test: normalize only message filenames in show json
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.
-rwxr-xr-xtest/multipart2
-rw-r--r--test/test-lib.sh2
2 files changed, 2 insertions, 2 deletions
diff --git a/test/multipart b/test/multipart
index 0527f848..344ed81a 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 fd64736b..6ce3b318 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