--- /dev/null
+Return-Path: <tomi.ollila@iki.fi>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id 4B53C431FDC\r
+ for <notmuch@notmuchmail.org>; Sun, 8 Dec 2013 10:59:55 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+ autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id FC-jYlAHNmzS for <notmuch@notmuchmail.org>;\r
+ Sun, 8 Dec 2013 10:59:47 -0800 (PST)\r
+Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
+ by olra.theworths.org (Postfix) with ESMTP id C957A431FD4\r
+ for <notmuch@notmuchmail.org>; Sun, 8 Dec 2013 10:59:46 -0800 (PST)\r
+Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
+ by guru.guru-group.fi (Postfix) with ESMTP id 69ABC10005D;\r
+ Sun, 8 Dec 2013 20:59:42 +0200 (EET)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: David Bremner <david@tethera.net>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH 2/4] test: sanitize Date and timestamp fields in json\r
+In-Reply-To: <1386517946-22054-3-git-send-email-david@tethera.net>\r
+References: <1386517946-22054-1-git-send-email-david@tethera.net>\r
+ <1386517946-22054-3-git-send-email-david@tethera.net>\r
+User-Agent: Notmuch/0.17~rc1+17~ga2e1a2f (http://notmuchmail.org) Emacs/24.3.1\r
+ (x86_64-unknown-linux-gnu)\r
+X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
+ $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
+ !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
+Date: Sun, 08 Dec 2013 20:59:42 +0200\r
+Message-ID: <m2bo0rnp7l.fsf@guru.guru-group.fi>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sun, 08 Dec 2013 18:59:55 -0000\r
+\r
+On Sun, Dec 08 2013, David Bremner <david@tethera.net> wrote:\r
+\r
+> Eventually we want test messages to have distinct dates to avoid\r
+> reproducability problems. This sanitization will prevent some test\r
+> failures when that change is made.\r
+>\r
+> Replace the use of a local function in maildir-sync with\r
+> notmuch_json_show_sanitize\r
+> ---\r
+> test/maildir-sync | 15 +++++----------\r
+> test/test-lib.sh | 4 +++-\r
+> 2 files changed, 8 insertions(+), 11 deletions(-)\r
+>\r
+> diff --git a/test/maildir-sync b/test/maildir-sync\r
+> index 33d2c58..3186e70 100755\r
+> --- a/test/maildir-sync\r
+> +++ b/test/maildir-sync\r
+> @@ -4,11 +4,6 @@ test_description="maildir synchronization"\r
+> \r
+> . ./test-lib.sh\r
+> \r
+> -# Avoid including the local value of MAIL_DIR in the result.\r
+> -filter_show_json() {\r
+> - sed -e "s|${MAIL_DIR}/|MAIL_DIR/|"\r
+> -}\r
+> -\r
+> # Create the expected maildir structure\r
+> mkdir $MAIL_DIR/cur\r
+> mkdir $MAIL_DIR/new\r
+> @@ -40,18 +35,18 @@ output=$(cd ${MAIL_DIR}/cur; ls -1 adding-replied*)\r
+> test_expect_equal "$output" "adding-replied-tag:2,RS"\r
+> \r
+> test_begin_subtest "notmuch show works with renamed file (without notmuch new)"\r
+> -output=$(notmuch show --format=json id:${gen_msg_id} | filter_show_json)\r
+> -test_expect_equal_json "$output" '[[[{"id": "adding-replied-tag@notmuch-test-suite",\r
+> +output=$(notmuch show --format=json id:${gen_msg_id} | notmuch_json_show_sanitize)\r
+> +test_expect_equal_json "$output" '[[[{"id": "XXXXX",\r
+> "match": true,\r
+> "excluded": false,\r
+> -"filename": "MAIL_DIR/cur/adding-replied-tag:2,RS",\r
+> -"timestamp": 978709437,\r
+> +"filename": "YYYYY",\r
+> +"timestamp": 42,\r
+> "date_relative": "2001-01-05",\r
+> "tags": ["inbox","replied"],\r
+> "headers": {"Subject": "Adding replied tag",\r
+> "From": "Notmuch Test Suite <test_suite@notmuchmail.org>",\r
+> "To": "Notmuch Test Suite <test_suite@notmuchmail.org>",\r
+> -"Date": "Fri, 05 Jan 2001 15:43:57 +0000"},\r
+> +"Date": "GENERATED_DATE"},\r
+> "body": [{"id": 1,\r
+> "content-type": "text/plain",\r
+> "content": "This is just a test message (#3)\n"}]},\r
+> diff --git a/test/test-lib.sh b/test/test-lib.sh\r
+> index 8611ba5..9d2f805 100644\r
+> --- a/test/test-lib.sh\r
+> +++ b/test/test-lib.sh\r
+> @@ -625,7 +625,9 @@ notmuch_json_show_sanitize ()\r
+> {\r
+> sed \\r
+> -e 's|"id": "[^"]*",|"id": "XXXXX",|g' \\r
+> - -e 's|"filename": "/[^"]*",|"filename": "YYYYY",|g'\r
+> + -e 's|"Date": "Fri[^"]*0000"|"Date": "GENERATED_DATE"|g' \\r
+\r
+Minor nit: The RE for changing to GENERATED_DATE is more different than\r
+required here and elsewhere in this patch series. Both could use \r
+'Fri, 05 Jan 2001' and '0000' parts...\r
+\r
+> + -e 's|"filename": "/[^"]*",|"filename": "YYYYY",|g' \\r
+> + -e 's|"timestamp": 97.......|"timestamp": 42|g'\r
+> }\r
+> \r
+> notmuch_emacs_error_sanitize ()\r
+> -- \r
+> 1.8.4.3\r
+>\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r