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 E2DFB431FCF for ; Wed, 30 May 2012 00:03:07 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] 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 VzevArM+Df6n for ; Wed, 30 May 2012 00:03:04 -0700 (PDT) Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 6C139431FCB for ; Wed, 30 May 2012 00:02:57 -0700 (PDT) Received: by mail-vc0-f181.google.com with SMTP id f1so4187995vcb.26 for ; Wed, 30 May 2012 00:02:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=NHC8TOvs5HJfu9pgGwx9/V3WZRIC2meydESzQrCGaXU=; b=Jh/8mhrAxzO+FetvgHd9iW/vdHAg8V7eQxyvNS2vcdP7NjgGigLEO0V2vsxibammg8 M1pwlY9euPeSDE9LXkXFpsmcxiYmEHU9mJnVBPaktJYSvjb0/aaAQ2euZ0ch9CZ0jGo5 PBN5wW/dKSQ0iL8XiHjA0jTHBC9A8rvkawzgcUOaDomIFziGTZTZhGF8YpoH3oWMzS9I mUcJTihHH1/svcfHCJYrMpFgQQ00f95jDL5qIVYeI26vtRDNnGQ6TevF0HAis6xiR1me 64TvQD6fzD63SP9m4o6CnqrC8wrg6Lr4bpBsHgqTZ0KdVLbZlxfl2q4cF2fopa5UY0S4 mVng== Received: by 10.52.31.137 with SMTP id a9mr13267069vdi.51.1338361377066; Wed, 30 May 2012 00:02:57 -0700 (PDT) Received: from nas.home.pioto.org (pool-71-182-155-97.pitbpa.fios.verizon.net. [71.182.155.97]) by mx.google.com with ESMTPS id j2sm28312621vde.16.2012.05.30.00.02.56 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 30 May 2012 00:02:56 -0700 (PDT) Received: by nas.home.pioto.org (Postfix, from userid 1001) id 630F0287D6; Wed, 30 May 2012 03:02:55 -0400 (EDT) From: Mike Kelly To: notmuch@notmuchmail.org Subject: [PATCH v2 9/9] tests: bsd sed doesn't allow replacing '\n' Date: Wed, 30 May 2012 03:02:04 -0400 Message-Id: <1338361324-57289-10-git-send-email-pioto@pioto.org> X-Mailer: git-send-email 1.7.10.2 In-Reply-To: <1338361324-57289-1-git-send-email-pioto@pioto.org> References: <1338361324-57289-1-git-send-email-pioto@pioto.org> X-Gm-Message-State: ALoCoQnkjNR+TE+Ms2w8by1XHb+JU20pcASZD/bvdNEK58M8ifG7yr0pLi5tv1mV0bQAGPY5lQtJ 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: Wed, 30 May 2012 07:03:08 -0000 Various workarounds still don't act quite the same way. So, just use perl, which seems to act the way these tests expect. --- test/maildir-sync | 2 +- test/multipart | 22 +++++++++++----------- test/test-lib.sh | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/test/maildir-sync b/test/maildir-sync index d72ec07..313238b 100755 --- a/test/maildir-sync +++ b/test/maildir-sync @@ -8,7 +8,7 @@ test_description="maildir synchronization" # --format=json" output includes some newlines. Also, need to avoid # including the local value of MAIL_DIR in the result. filter_show_json() { - sed -e 's/, /,\n/g' | sed -e "s|${MAIL_DIR}/|MAIL_DIR/|" + perl -pe 's/, /,\n/g' | sed -e "s|${MAIL_DIR}/|MAIL_DIR/|" echo } diff --git a/test/multipart b/test/multipart index 72d3927..b15eea0 100755 --- a/test/multipart +++ b/test/multipart @@ -319,7 +319,7 @@ test_expect_success \ "notmuch show --format=text --part=8 'id:87liy5ap00.fsf@yoom.home.cworth.org'" test_begin_subtest "--format=json --part=0, full message" -notmuch show --format=json --part=0 'id:87liy5ap00.fsf@yoom.home.cworth.org' | sed 's|{"id":|\n{"id":|g' >OUTPUT +notmuch show --format=json --part=0 'id:87liy5ap00.fsf@yoom.home.cworth.org' | perl -pe 's|{"id":|\n{"id":|g' >OUTPUT echo >>OUTPUT # expect *no* newline at end of output cat <EXPECTED @@ -337,7 +337,7 @@ EOF test_expect_equal_file OUTPUT EXPECTED test_begin_subtest "--format=json --part=1, message body" -notmuch show --format=json --part=1 'id:87liy5ap00.fsf@yoom.home.cworth.org' | sed 's|{"id":|\n{"id":|g' >OUTPUT +notmuch show --format=json --part=1 'id:87liy5ap00.fsf@yoom.home.cworth.org' | perl -pe 's|{"id":|\n{"id":|g' >OUTPUT echo >>OUTPUT # expect *no* newline at end of output cat <EXPECTED @@ -354,7 +354,7 @@ EOF test_expect_equal_file OUTPUT EXPECTED test_begin_subtest "--format=json --part=2, multipart/mixed" -notmuch show --format=json --part=2 'id:87liy5ap00.fsf@yoom.home.cworth.org' | sed 's|{"id":|\n{"id":|g' >OUTPUT +notmuch show --format=json --part=2 'id:87liy5ap00.fsf@yoom.home.cworth.org' | perl -pe 's|{"id":|\n{"id":|g' >OUTPUT echo >>OUTPUT # expect *no* newline at end of output cat <EXPECTED @@ -369,7 +369,7 @@ EOF test_expect_equal_file OUTPUT EXPECTED test_begin_subtest "--format=json --part=3, rfc822 part" -notmuch show --format=json --part=3 'id:87liy5ap00.fsf@yoom.home.cworth.org' | sed 's|{"id":|\n{"id":|g' >OUTPUT +notmuch show --format=json --part=3 'id:87liy5ap00.fsf@yoom.home.cworth.org' | perl -pe 's|{"id":|\n{"id":|g' >OUTPUT echo >>OUTPUT # expect *no* newline at end of output cat <EXPECTED @@ -381,7 +381,7 @@ EOF test_expect_equal_file OUTPUT EXPECTED test_begin_subtest "--format=json --part=4, rfc822's multipart/alternative" -notmuch show --format=json --part=4 'id:87liy5ap00.fsf@yoom.home.cworth.org' | sed 's|{"id":|\n{"id":|g' >OUTPUT +notmuch show --format=json --part=4 'id:87liy5ap00.fsf@yoom.home.cworth.org' | perl -pe 's|{"id":|\n{"id":|g' >OUTPUT echo >>OUTPUT # expect *no* newline at end of output cat <EXPECTED @@ -392,7 +392,7 @@ EOF test_expect_equal_file OUTPUT EXPECTED test_begin_subtest "--format=json --part=5, rfc822's html part" -notmuch show --format=json --part=5 'id:87liy5ap00.fsf@yoom.home.cworth.org' | sed 's|{"id":|\n{"id":|g' >OUTPUT +notmuch show --format=json --part=5 'id:87liy5ap00.fsf@yoom.home.cworth.org' | perl -pe 's|{"id":|\n{"id":|g' >OUTPUT echo >>OUTPUT # expect *no* newline at end of output cat <EXPECTED @@ -401,7 +401,7 @@ EOF test_expect_equal_file OUTPUT EXPECTED test_begin_subtest "--format=json --part=6, rfc822's text part" -notmuch show --format=json --part=6 'id:87liy5ap00.fsf@yoom.home.cworth.org' | sed 's|{"id":|\n{"id":|g' >OUTPUT +notmuch show --format=json --part=6 'id:87liy5ap00.fsf@yoom.home.cworth.org' | perl -pe 's|{"id":|\n{"id":|g' >OUTPUT echo >>OUTPUT # expect *no* newline at end of output cat <EXPECTED @@ -410,7 +410,7 @@ EOF test_expect_equal_file OUTPUT EXPECTED test_begin_subtest "--format=json --part=7, inline attachment" -notmuch show --format=json --part=7 'id:87liy5ap00.fsf@yoom.home.cworth.org' | sed 's|{"id":|\n{"id":|g' >OUTPUT +notmuch show --format=json --part=7 'id:87liy5ap00.fsf@yoom.home.cworth.org' | perl -pe 's|{"id":|\n{"id":|g' >OUTPUT echo >>OUTPUT # expect *no* newline at end of output cat <EXPECTED @@ -419,7 +419,7 @@ EOF test_expect_equal_file OUTPUT EXPECTED test_begin_subtest "--format=json --part=8, plain text part" -notmuch show --format=json --part=8 'id:87liy5ap00.fsf@yoom.home.cworth.org' | sed 's|{"id":|\n{"id":|g' >OUTPUT +notmuch show --format=json --part=8 'id:87liy5ap00.fsf@yoom.home.cworth.org' | perl -pe 's|{"id":|\n{"id":|g' >OUTPUT echo >>OUTPUT # expect *no* newline at end of output cat <EXPECTED @@ -428,7 +428,7 @@ EOF test_expect_equal_file OUTPUT EXPECTED test_begin_subtest "--format=json --part=9, pgp signature (unverified)" -notmuch show --format=json --part=9 'id:87liy5ap00.fsf@yoom.home.cworth.org' | sed 's|{"id":|\n{"id":|g' >OUTPUT +notmuch show --format=json --part=9 'id:87liy5ap00.fsf@yoom.home.cworth.org' | perl -pe 's|{"id":|\n{"id":|g' >OUTPUT echo >>OUTPUT # expect *no* newline at end of output cat <EXPECTED @@ -669,4 +669,4 @@ notmuch show --format=raw --part=3 id:base64-part-with-crlf > crlf.out echo -n -e "\xEF\x0D\x0A" > crlf.expected test_expect_equal_file crlf.out crlf.expected -test_done \ No newline at end of file +test_done diff --git a/test/test-lib.sh b/test/test-lib.sh index 2ac92f7..7a3602e 100644 --- a/test/test-lib.sh +++ b/test/test-lib.sh @@ -587,7 +587,7 @@ notmuch_show_sanitize_all () notmuch_json_show_sanitize () { - sed -e 's|, |,\n |g' | \ + perl -pe 's|, |,\n |g' | \ sed \ -e 's|"id": "[^"]*",|"id": "XXXXX",|' \ -e 's|"filename": "[^"]*",|"filename": "YYYYY",|' -- 1.7.10.2