--- /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 78CA2431FAF\r
+ for <notmuch@notmuchmail.org>; Tue, 27 Nov 2012 02:04:24 -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 PcdLMyzXn93I for <notmuch@notmuchmail.org>;\r
+ Tue, 27 Nov 2012 02:04:23 -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 39538431FAE\r
+ for <notmuch@notmuchmail.org>; Tue, 27 Nov 2012 02:04:23 -0800 (PST)\r
+Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
+ by guru.guru-group.fi (Postfix) with ESMTP id 8DC8F1000E5;\r
+ Tue, 27 Nov 2012 12:04:19 +0200 (EET)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: Austin Clements <amdragon@MIT.EDU>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH] test: Quote $output in calls to test_expect_equal\r
+In-Reply-To: <1353992297-14473-1-git-send-email-amdragon@mit.edu>\r
+References: <1353992297-14473-1-git-send-email-amdragon@mit.edu>\r
+User-Agent: Notmuch/0.14+84~g8a199bf (http://notmuchmail.org) Emacs/24.2.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: Tue, 27 Nov 2012 12:04:18 +0200\r
+Message-ID: <m27gp7nyzh.fsf@guru.guru-group.fi>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=utf-8\r
+Content-Transfer-Encoding: quoted-printable\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: Tue, 27 Nov 2012 10:04:24 -0000\r
+\r
+On Tue, Nov 27 2012, Austin Clements <amdragon@MIT.EDU> wrote:\r
+\r
+> Previously, many tests in emacs-subject-to-filename didn't quote the\r
+> $output argument to test_expect_equal. As a result, if $output was\r
+> empty, test_expect_equal would be passed only one argument and would\r
+> abort the entire test script. By quoting the argument, we ensure\r
+> test_expect_equal will always receive two arguments.\r
+> ---\r
+\r
+Looks SO good to me. +1 !\r
+\r
+Tomi\r
+\r
+PS: we should do something to detect aborting scripts\r
+ some options: 1) trap, 2) detect test_done not run, 3) return value\r
+ 4) at the beginning of script state count of expexted tests\r
+\r
+> test/emacs-subject-to-filename | 18 +++++++++---------\r
+> 1 file changed, 9 insertions(+), 9 deletions(-)\r
+>\r
+> diff --git a/test/emacs-subject-to-filename b/test/emacs-subject-to-filen=\r
+ame\r
+> index a0ffdfe..1e94a98 100755\r
+> --- a/test/emacs-subject-to-filename\r
+> +++ b/test/emacs-subject-to-filename\r
+> @@ -60,55 +60,55 @@ test_begin_subtest "filename #1"\r
+> output=3D$(test_emacs '(notmuch-wash-subject-to-filename\r
+> "just a subject line")'\r
+> )\r
+> -test_expect_equal $output '"just-a-subject-line"'\r
+> +test_expect_equal "$output" '"just-a-subject-line"'\r
+>=20=20\r
+> test_begin_subtest "filename #2"\r
+> output=3D$(test_emacs '(notmuch-wash-subject-to-filename\r
+> " [any] [prefixes are ] [removed!] from the subject")'\r
+> )\r
+> -test_expect_equal $output '"from-the-subject"'\r
+> +test_expect_equal "$output" '"from-the-subject"'\r
+>=20=20\r
+> test_begin_subtest "filename #3"\r
+> output=3D$(test_emacs '(notmuch-wash-subject-to-filename\r
+> " leading and trailing space ")'\r
+> )\r
+> -test_expect_equal $output '"leading-and-trailing-space"'\r
+> +test_expect_equal "$output" '"leading-and-trailing-space"'\r
+>=20=20\r
+> test_begin_subtest "filename #4"\r
+> output=3D$(test_emacs '(notmuch-wash-subject-to-filename\r
+> "!# leading ()// &%, and in between_and_trailing garbage ()(&%%")'\r
+> )\r
+> -test_expect_equal $output '"-leading-and-in-between_and_trailing-garbage=\r
+"'\r
+> +test_expect_equal "$output" '"-leading-and-in-between_and_trailing-garba=\r
+ge"'\r
+>=20=20\r
+> test_begin_subtest "filename #5"\r
+> output=3D$(test_emacs '(notmuch-wash-subject-to-filename\r
+> "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.-_0123456789=\r
+0")'\r
+> )\r
+> -test_expect_equal $output '"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqr=\r
+stuvwxyz.-_01234567890"'\r
+> +test_expect_equal "$output" '"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnop=\r
+qrstuvwxyz.-_01234567890"'\r
+>=20=20\r
+> test_begin_subtest "filename #6"\r
+> output=3D$(test_emacs '(notmuch-wash-subject-to-filename\r
+> "sequences of ... are squashed and trailing are removed ...")'\r
+> )\r
+> -test_expect_equal $output '"sequences-of-.-are-squashed-and-trailing-are=\r
+-removed"'\r
+> +test_expect_equal "$output" '"sequences-of-.-are-squashed-and-trailing-a=\r
+re-removed"'\r
+>=20=20\r
+> test_begin_subtest "filename #7"\r
+> output=3D$(test_emacs '(notmuch-wash-subject-to-filename\r
+> "max length test" 1)'\r
+> )\r
+> -test_expect_equal $output '"m"'\r
+> +test_expect_equal "$output" '"m"'\r
+>=20=20\r
+> test_begin_subtest "filename #8"\r
+> output=3D$(test_emacs '(notmuch-wash-subject-to-filename\r
+> "max length test /&(/%&/%%&=C2=A4%=C2=A4" 20)'\r
+> )\r
+> -test_expect_equal $output '"max-length-test"'\r
+> +test_expect_equal "$output" '"max-length-test"'\r
+>=20=20\r
+> test_begin_subtest "filename #9"\r
+> output=3D$(test_emacs '(notmuch-wash-subject-to-filename\r
+> "[a prefix] [is only separated] by [spaces], so \"by\" is not okay=\r
+!")'\r
+> )\r
+> -test_expect_equal $output '"by-spaces-so-by-is-not-okay"'\r
+> +test_expect_equal "$output" '"by-spaces-so-by-is-not-okay"'\r
+>=20=20\r
+> # test notmuch-wash-subject-to-patch-filename (subject)\r
+> test_begin_subtest "patch filename #1"\r
+> --=20\r
+> 1.7.10.4\r
+>\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r