]> git.notmuchmail.org Git - notmuch/commitdiff
test: pass expected output through json_sanitize in 2 places
authorDavid Bremner <david@tethera.net>
Sun, 8 Dec 2013 08:39:05 +0000 (16:39 +0800)
committerDavid Bremner <david@tethera.net>
Mon, 9 Dec 2013 13:20:15 +0000 (21:20 +0800)
This makes the tests more robust against changes in the
sanitization rules.

test/missing-headers
test/multipart

index 43e861bc69dffb8ec86036d5207738eb3ec12b54..cb38301c255a1d0b8dd661636499930862fd5b7f 100755 (executable)
@@ -95,7 +95,7 @@ Body
 
 test_begin_subtest "Show: json"
 output=$(notmuch show --format=json '*' | notmuch_json_show_sanitize)
-test_expect_equal_json "$output" '
+expected=$(notmuch_json_show_sanitize <<EOF
 [
     [
         [
@@ -156,7 +156,9 @@ test_expect_equal_json "$output" '
             []
         ]
     ]
-]'
-
+]
+EOF
+)
+test_expect_equal_json "$output" "$expected"
 
 test_done
index b40fa2caacb685d57a0a908b84473f12f4f92fd4..85cbf672da89f0c72ffa1b67f597ed47422029b4 100755 (executable)
@@ -594,7 +594,7 @@ test_expect_equal_file OUTPUT EXPECTED
 
 test_begin_subtest "'notmuch reply' to a multipart message with json format"
 notmuch reply --format=json 'id:87liy5ap00.fsf@yoom.home.cworth.org' | notmuch_json_show_sanitize >OUTPUT
-cat <<EOF >EXPECTED
+notmuch_json_show_sanitize <<EOF >EXPECTED
 {"reply-headers": {"Subject": "Re: Multipart message",
  "From": "Notmuch Test Suite <test_suite@notmuchmail.org>",
  "To": "Carl Worth <cworth@cworth.org>, cworth@cworth.org",