From 05586ecc6bd38798209121fbab2d03bd0e229d2c Mon Sep 17 00:00:00 2001 From: Tomi Ollila Date: Sun, 8 Dec 2013 20:54:41 +0200 Subject: [PATCH] Re: [PATCH 1/4] test: pass expected output through json_sanitize in 2 places --- b2/597f647d2486d1955fdd9884205e30df9d08ff | 111 ++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 b2/597f647d2486d1955fdd9884205e30df9d08ff diff --git a/b2/597f647d2486d1955fdd9884205e30df9d08ff b/b2/597f647d2486d1955fdd9884205e30df9d08ff new file mode 100644 index 000000000..3822ac67f --- /dev/null +++ b/b2/597f647d2486d1955fdd9884205e30df9d08ff @@ -0,0 +1,111 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 1AE91431E62 + for ; Sun, 8 Dec 2013 10:54:55 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id hQZJzRGytZBZ for ; + Sun, 8 Dec 2013 10:54:47 -0800 (PST) +Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) + by olra.theworths.org (Postfix) with ESMTP id 47BC6431FD4 + for ; Sun, 8 Dec 2013 10:54:47 -0800 (PST) +Received: from guru.guru-group.fi (localhost [IPv6:::1]) + by guru.guru-group.fi (Postfix) with ESMTP id 47F8A10005D; + Sun, 8 Dec 2013 20:54:41 +0200 (EET) +From: Tomi Ollila +To: David Bremner , notmuch@notmuchmail.org +Subject: Re: [PATCH 1/4] test: pass expected output through json_sanitize in 2 + places +In-Reply-To: <1386517946-22054-2-git-send-email-david@tethera.net> +References: <1386517946-22054-1-git-send-email-david@tethera.net> + <1386517946-22054-2-git-send-email-david@tethera.net> +User-Agent: Notmuch/0.17~rc1+17~ga2e1a2f (http://notmuchmail.org) Emacs/24.3.1 + (x86_64-unknown-linux-gnu) +X-Face: HhBM'cA~ +MIME-Version: 1.0 +Content-Type: text/plain +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Sun, 08 Dec 2013 18:54:55 -0000 + +On Sun, Dec 08 2013, David Bremner wrote: + +> This makes the tests more robust against changes in the +> sanitization rules. +> --- +> test/missing-headers | 8 +++++--- +> test/multipart | 2 +- +> 2 files changed, 6 insertions(+), 4 deletions(-) +> +> diff --git a/test/missing-headers b/test/missing-headers +> index 43e861b..cb38301 100755 +> --- a/test/missing-headers +> +++ b/test/missing-headers +> @@ -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 < [ +> [ +> [ +> @@ -156,7 +156,9 @@ test_expect_equal_json "$output" ' +> [] +> ] +> ] +> -]' +> - +> +] +> +EOF +> +) +> +test_expect_equal_json "$output" "$expected" +> +> test_done +> diff --git a/test/multipart b/test/multipart +> index b40fa2c..73f8fdd 100755 +> --- a/test/multipart +> +++ b/test/multipart +> @@ -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 <EXPECTED +> +cat <EXPECTED + +notmuch_json_show_sanitize <EXPECTED + +would do it. + +> {"reply-headers": {"Subject": "Re: Multipart message", +> "From": "Notmuch Test Suite ", +> "To": "Carl Worth , cworth@cworth.org", +> -- +> 1.8.4.3 +> +> _______________________________________________ +> notmuch mailing list +> notmuch@notmuchmail.org +> http://notmuchmail.org/mailman/listinfo/notmuch -- 2.26.2