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