From 57ea69d0f041d51efb9fc2aa7df4eff82a19a884 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Tue, 27 Nov 2012 23:58:17 +1900 Subject: [PATCH] [PATCH] test: Quote $output in calls to test_expect_equal --- ae/85cd3ef4700b9a4b1ebec3298246fc49aa8c72 | 155 ++++++++++++++++++++++ 1 file changed, 155 insertions(+) create mode 100644 ae/85cd3ef4700b9a4b1ebec3298246fc49aa8c72 diff --git a/ae/85cd3ef4700b9a4b1ebec3298246fc49aa8c72 b/ae/85cd3ef4700b9a4b1ebec3298246fc49aa8c72 new file mode 100644 index 000000000..84b11dbfa --- /dev/null +++ b/ae/85cd3ef4700b9a4b1ebec3298246fc49aa8c72 @@ -0,0 +1,155 @@ +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 534B0431FAF + for ; Mon, 26 Nov 2012 20:58:24 -0800 (PST) +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 528Swl4YVmpA for ; + Mon, 26 Nov 2012 20:58:22 -0800 (PST) +Received: from dmz-mailsec-scanner-5.mit.edu (DMZ-MAILSEC-SCANNER-5.MIT.EDU + [18.7.68.34]) + by olra.theworths.org (Postfix) with ESMTP id 5AC0A431FAE + for ; Mon, 26 Nov 2012 20:58:22 -0800 (PST) +X-AuditID: 12074422-b7f196d00000398d-88-50b4486d407c +Received: from mailhub-auth-2.mit.edu ( [18.7.62.36]) + by dmz-mailsec-scanner-5.mit.edu (Symantec Messaging Gateway) with SMTP + id 6B.FA.14733.D6844B05; Mon, 26 Nov 2012 23:58:21 -0500 (EST) +Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) + by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id qAR4wK5X006906; + Mon, 26 Nov 2012 23:58:20 -0500 +Received: from drake.dyndns.org + (209-6-116-242.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com + [209.6.116.242]) (authenticated bits=0) + (User authenticated as amdragon@ATHENA.MIT.EDU) + by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id qAR4wIlw024159 + (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); + Mon, 26 Nov 2012 23:58:20 -0500 (EST) +Received: from amthrax by drake.dyndns.org with local (Exim 4.77) + (envelope-from ) + id 1TdDFS-0003m5-FT; Mon, 26 Nov 2012 23:58:18 -0500 +From: Austin Clements +To: notmuch@notmuchmail.org +Subject: [PATCH] test: Quote $output in calls to test_expect_equal +Date: Mon, 26 Nov 2012 23:58:17 -0500 +Message-Id: <1353992297-14473-1-git-send-email-amdragon@mit.edu> +X-Mailer: git-send-email 1.7.10.4 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +X-Brightmail-Tracker: + H4sIAAAAAAAAA+NgFrrLIsWRmVeSWpSXmKPExsUixG6nopvrsSXA4MtDM4vrN2cyOzB6PFt1 + izmAMYrLJiU1J7MstUjfLoErY/uxQ2wFvyQrvu5SaGDcKtbFyMEhIWAisX+uXxcjJ5ApJnHh + 3nq2LkYuDiGBfYwSU57OZodwNjBKfHrUyQZSJSTwiEli94l0iMRcRoneM39YQBJsAhoS2/Yv + ZwSxRQSkJXbenc0KsoFZQE3iT5cKSFhYIEPiwPedTCA2i4CqxK/W92wgJbwCDhIHfqhCHKEo + 0f1sAtgqXgFBiZMzn7BATFGXWD9PCCTMLCAv0bx1NvMERoFZSKpmIVTNQlK1gJF5FaNsSm6V + bm5iZk5xarJucXJiXl5qka6pXm5miV5qSukmRnAouijtYPx5UOkQowAHoxIP74ElmwOEWBPL + iitzDzFKcjApifIecd8SIMSXlJ9SmZFYnBFfVJqTWnyIUYKDWUmEd7EOUI43JbGyKrUoHyYl + zcGiJM57LeWmv5BAemJJanZqakFqEUxWhoNDSYJ3KshQwaLU9NSKtMycEoQ0EwcnyHAeoOH5 + IDW8xQWJucWZ6RD5U4yKUuK8k9yAEgIgiYzSPLheWKp4xSgO9IowbzVIOw8wzcB1vwIazAQ0 + OPn6RpDBJYkIKakGxhXTHvAd/uJXJ82+dP9My1NNsx/PyXu0WlmwQWTGBR371VMSql+tvvKg + Yb/Fxxfn2T69r5335IPrHLWzZhN+xiu6fZrKXZeXvP73adczD5jYl00p7CmKqHj5/vG6aV7x + rL0p2ZtiV0+zm3ppA2tnxLf+wnizyavuXUtc/Ibp4zKpsAuT2K7kbLBSYinOSDTUYi4qTgQA + Nezv1fACAAA= +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: Tue, 27 Nov 2012 04:58:24 -0000 + +Previously, many tests in emacs-subject-to-filename didn't quote the +$output argument to test_expect_equal. As a result, if $output was +empty, test_expect_equal would be passed only one argument and would +abort the entire test script. By quoting the argument, we ensure +test_expect_equal will always receive two arguments. +--- + test/emacs-subject-to-filename | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +diff --git a/test/emacs-subject-to-filename b/test/emacs-subject-to-filename +index a0ffdfe..1e94a98 100755 +--- a/test/emacs-subject-to-filename ++++ b/test/emacs-subject-to-filename +@@ -60,55 +60,55 @@ test_begin_subtest "filename #1" + output=$(test_emacs '(notmuch-wash-subject-to-filename + "just a subject line")' + ) +-test_expect_equal $output '"just-a-subject-line"' ++test_expect_equal "$output" '"just-a-subject-line"' + + test_begin_subtest "filename #2" + output=$(test_emacs '(notmuch-wash-subject-to-filename + " [any] [prefixes are ] [removed!] from the subject")' + ) +-test_expect_equal $output '"from-the-subject"' ++test_expect_equal "$output" '"from-the-subject"' + + test_begin_subtest "filename #3" + output=$(test_emacs '(notmuch-wash-subject-to-filename + " leading and trailing space ")' + ) +-test_expect_equal $output '"leading-and-trailing-space"' ++test_expect_equal "$output" '"leading-and-trailing-space"' + + test_begin_subtest "filename #4" + output=$(test_emacs '(notmuch-wash-subject-to-filename + "!# leading ()// &%, and in between_and_trailing garbage ()(&%%")' + ) +-test_expect_equal $output '"-leading-and-in-between_and_trailing-garbage"' ++test_expect_equal "$output" '"-leading-and-in-between_and_trailing-garbage"' + + test_begin_subtest "filename #5" + output=$(test_emacs '(notmuch-wash-subject-to-filename + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.-_01234567890")' + ) +-test_expect_equal $output '"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.-_01234567890"' ++test_expect_equal "$output" '"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.-_01234567890"' + + test_begin_subtest "filename #6" + output=$(test_emacs '(notmuch-wash-subject-to-filename + "sequences of ... are squashed and trailing are removed ...")' + ) +-test_expect_equal $output '"sequences-of-.-are-squashed-and-trailing-are-removed"' ++test_expect_equal "$output" '"sequences-of-.-are-squashed-and-trailing-are-removed"' + + test_begin_subtest "filename #7" + output=$(test_emacs '(notmuch-wash-subject-to-filename + "max length test" 1)' + ) +-test_expect_equal $output '"m"' ++test_expect_equal "$output" '"m"' + + test_begin_subtest "filename #8" + output=$(test_emacs '(notmuch-wash-subject-to-filename + "max length test /&(/%&/%%&¤%¤" 20)' + ) +-test_expect_equal $output '"max-length-test"' ++test_expect_equal "$output" '"max-length-test"' + + test_begin_subtest "filename #9" + output=$(test_emacs '(notmuch-wash-subject-to-filename + "[a prefix] [is only separated] by [spaces], so \"by\" is not okay!")' + ) +-test_expect_equal $output '"by-spaces-so-by-is-not-okay"' ++test_expect_equal "$output" '"by-spaces-so-by-is-not-okay"' + + # test notmuch-wash-subject-to-patch-filename (subject) + test_begin_subtest "patch filename #1" +-- +1.7.10.4 + -- 2.26.2