--- /dev/null
+Return-Path: <jani@nikula.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 394EE431FB6\r
+ for <notmuch@notmuchmail.org>; Thu, 31 May 2012 01:28:31 -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 mXTPFzHpc6de for <notmuch@notmuchmail.org>;\r
+ Thu, 31 May 2012 01:28:30 -0700 (PDT)\r
+Received: from mail-vb0-f53.google.com (mail-vb0-f53.google.com\r
+ [209.85.212.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id 65241431FAF\r
+ for <notmuch@notmuchmail.org>; Thu, 31 May 2012 01:28:30 -0700 (PDT)\r
+Received: by vbbfc26 with SMTP id fc26so641586vbb.26\r
+ for <notmuch@notmuchmail.org>; Thu, 31 May 2012 01:28:29 -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:subject:in-reply-to:references:user-agent:date:message-id\r
+ :mime-version:content-type:x-gm-message-state;\r
+ bh=jC/d4Xg4c5RkXjuWnQezPJITZ3Hgigtwerv96FwW5j4=;\r
+ b=lGsG57Tme5TiBuKjgKM26MnRV4KgrsRUfdAyJbPBd/Q9FX3XCPEewIZhNQN7otLndf\r
+ iaFzCuIVtX/aZJ9BhkSLHT+SPAtcVeHkDlxxRDr/YB30VRhkCKURIdV3EE81qcLClAZ+\r
+ pgAfUxBzsOUNf6C+bDqSpHnGD1tSuq91/NuRMD2F88kBtyketQLyUEs7mI5qkYYRFjTt\r
+ 8iNioSLSY0qCD7NB9nAJGHtlrW8TdcX7A8b9tjg9trRezUL84rV/cmgLG07VFpI+bgla\r
+ F6hiqYsuux3S3stmLkiWijZUejzJnGvHiIFQ+dHYMHP9TNXvX0t8NszePTqwR7sjvL1i\r
+ vdsQ==\r
+Received: by 10.220.241.130 with SMTP id le2mr7243345vcb.38.1338452909690;\r
+ Thu, 31 May 2012 01:28:29 -0700 (PDT)\r
+Received: from localhost (nikula.org. [92.243.24.172])\r
+ by mx.google.com with ESMTPS id i19sm3750912vdt.18.2012.05.31.01.28.27\r
+ (version=SSLv3 cipher=OTHER); Thu, 31 May 2012 01:28:28 -0700 (PDT)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: Tomi Ollila <tomi.ollila@iki.fi>,\r
+ Jameson Graef Rollins <jrollins@finestructure.net>,\r
+ Mike Kelly <pioto@pioto.org>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH v2 7/9] test/count: fix numeric comparision tests on\r
+ FreeBSD\r
+In-Reply-To: <m2fwahxu2l.fsf@guru.guru-group.fi>\r
+References: <1338361324-57289-1-git-send-email-pioto@pioto.org>\r
+ <1338361324-57289-8-git-send-email-pioto@pioto.org>\r
+ <877gvtxvka.fsf@servo.finestructure.net>\r
+ <m2fwahxu2l.fsf@guru.guru-group.fi>\r
+User-Agent: Notmuch/0.13+9~ga1668d0 (http://notmuchmail.org) Emacs/23.1.1\r
+ (i686-pc-linux-gnu)\r
+Date: Thu, 31 May 2012 08:28:24 +0000\r
+Message-ID: <874nqw4uvr.fsf@nikula.org>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+X-Gm-Message-State:\r
+ ALoCoQkrNFDNddCV3PnikfuzAydYQxHNP2KVhylomc2a+5Xaor8lvnOEwaIPdqCrTvfhH2OkIRBz\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: Thu, 31 May 2012 08:28:31 -0000\r
+\r
+On Wed, 30 May 2012, Tomi Ollila <tomi.ollila@iki.fi> wrote:\r
+> On Wed, May 30 2012, Jameson Graef Rollins <jrollins@finestructure.net> wrote:\r
+>\r
+>> On Wed, May 30 2012, Mike Kelly <pioto@pioto.org> wrote:\r
+>>> FreeBSD's `wc -l` includes some white space in front of the number.\r
+>>> Instead, we add a test_expect_equal_num() to test-lib.sh, which ensures\r
+>>> we do a proper numeric comparision, and in a portable way.\r
+>>\r
+>> Is there a way we can avoid adding another new test function here? This\r
+>> new function is almost completely identical with the old one, except\r
+>> that it uses "test .. -eq" instead of "[ .. =". If the problem is just\r
+>> that the arguments occasionally contain superfluous spaces, I would\r
+>> rather see the existing function just strip the spaces. Of maybe add an\r
+>> option to the test to ask for arithmetic rather than string comparison.\r
+>> That would be preferable to introducing an new function that is\r
+>> confusingly similar to an existing one.\r
+>\r
+> I liked Mike's suggestion as I also thought the options; stripping in\r
+> test_expect_equal cannot be done as there might be whitespace differences\r
+> which mean failure arguments to test_expect_equal cannot be given without\r
+> quotes as variable might be split into multiple args. if test_expect_equal\r
+> were changed to take comparison argument (like '-eq' or '=') then all\r
+> calls would need to be changes (and function name could be changed to\r
+> something more generic...) None of these sounded as good options...\r
+>\r
+> But, there is at least one option more:\r
+>\r
+> test_expect_equal \\r
+> - "`notmuch search --output=messages ${SEARCH} | wc -l`" \\r
+> + "$((`notmuch search --output=messages ${SEARCH} | wc -l`))" \\r
+> "`notmuch count --output=messages ${SEARCH}`"\r
+>\r
+> this makes arithmetic evaluation -- no operation to be done but\r
+> the spaces around the value are dropped.\r
+\r
+But it's non-obvious. How about just adding '| tr -d " "' to the end and\r
+be done with it?\r
+\r
+J.\r
+\r
+\r
+>\r
+>>\r
+>> jamie.\r
+>\r
+> Tomi\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r