From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 6F4B4431FAE for ; Tue, 4 Dec 2012 13:26:57 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" 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 ysbysM4gv3xS for ; Tue, 4 Dec 2012 13:26:53 -0800 (PST) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com [209.85.215.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 3AEDF431FDE for ; Tue, 4 Dec 2012 13:26:45 -0800 (PST) Received: by mail-la0-f53.google.com with SMTP id w12so3787110lag.26 for ; Tue, 04 Dec 2012 13:26:43 -0800 (PST) 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 :in-reply-to:references:x-gm-message-state; bh=RxUHeQW3VuU2eKDL4ZL1LSHCtD344lesDvEg/JURyX0=; b=TPiFhx+DH13jeRv/WbuDobmxPXtUlT3hPBaxB9vcfNn+8pFZnHSjc9XvRqCJdP7bjg oKM6GSziUlhHoPEWbDkDW7ZOYKPKXbS+b8FrL2bK98qiNSZ+3ckuqe8b3ztwqUnOrWAc c80NmHmSAKXJZK+GhSaiuaqWzJFvySpFzV1/cwTgQCy+wtJOX0GLSHS2dgDF9KYpvX0m Z/ubHcp7OblLV0gxYF+S6hijA9BkBX2/I6Se0b2n/GE4gSr3l/VcU0qiCr3WTuHW6g72 FhStqf1NuchFbWCJTk3901ai5krpqyjT45CpxUPyaxmshRwm4mWLOt7taknezFqYXGul XXVw== Received: by 10.152.125.7 with SMTP id mm7mr1727220lab.2.1354656403659; Tue, 04 Dec 2012 13:26:43 -0800 (PST) Received: from localhost (dsl-hkibrasgw4-fe51df00-27.dhcp.inet.fi. [80.223.81.27]) by mx.google.com with ESMTPS id so7sm1195821lab.0.2012.12.04.13.26.42 (version=SSLv3 cipher=OTHER); Tue, 04 Dec 2012 13:26:42 -0800 (PST) From: Jani Nikula To: notmuch@notmuchmail.org Subject: [PATCH 2/3] test: wrap 'wc -l' results in arithmetic evaluation to strip whitespace Date: Tue, 4 Dec 2012 23:26:32 +0200 Message-Id: <34cf9a648edbee52377eaaddc949f20a4defe4f9.1354656085.git.jani@nikula.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: References: In-Reply-To: References: X-Gm-Message-State: ALoCoQng1eQBFc2h2wFyB1jxiattFEA5AAoVq1l+TjAXO3ccRDBiDf0clWQiGjIapvWliru4jei0 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, 04 Dec 2012 21:26:57 -0000 This is for portability, as 'wc -l' emits whitespace on some BSD variants. Suggested by Tomi Ollila . --- Updated version of id:1338361324-57289-8-git-send-email-pioto@pioto.org --- test/count | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/test/count b/test/count index 8e587ff..879b114 100755 --- a/test/count +++ b/test/count @@ -4,24 +4,28 @@ test_description='"notmuch count" for messages and threads' add_email_corpus +# Note: The 'wc -l' results below are wrapped in arithmetic evaluation +# $((...)) to strip whitespace. This is for portability, as 'wc -l' +# emits whitespace on some BSD variants. + test_begin_subtest "message count is the default for notmuch count" test_expect_equal \ - "`notmuch search --output=messages '*' | wc -l`" \ + "$((`notmuch search --output=messages '*' | wc -l`))" \ "`notmuch count '*'`" test_begin_subtest "message count with --output=messages" test_expect_equal \ - "`notmuch search --output=messages '*' | wc -l`" \ + "$((`notmuch search --output=messages '*' | wc -l`))" \ "`notmuch count --output=messages '*'`" test_begin_subtest "thread count with --output=threads" test_expect_equal \ - "`notmuch search --output=threads '*' | wc -l`" \ + "$((`notmuch search --output=threads '*' | wc -l`))" \ "`notmuch count --output=threads '*'`" test_begin_subtest "thread count is the default for notmuch search" test_expect_equal \ - "`notmuch search '*' | wc -l`" \ + "$((`notmuch search '*' | wc -l`))" \ "`notmuch count --output=threads '*'`" test_begin_subtest "count with no matching messages" -- 1.7.10.4