[PATCH 06/10] Fix test/count on FreeBSD

Subject: [PATCH 06/10] Fix test/count on FreeBSD

Date: Fri, 25 May 2012 09:43:27 -0400

To: notmuch@notmuchmail.org

Cc:

From: Mike Kelly


FreeBSD's `wc -l` includes some white space in front of the number, so
trim it off.
---
 test/count |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/test/count b/test/count
index 300b171..618dbb9 100755
--- a/test/count
+++ b/test/count
@@ -8,22 +8,22 @@ SEARCH="\"*\""
 
 test_begin_subtest "message count is the default for notmuch count"
 test_expect_equal \
-    "`notmuch search --output=messages ${SEARCH} | wc -l`" \
+    "`notmuch search --output=messages ${SEARCH} | wc -l |sed 's/^[[:space:]]*//'`" \
     "`notmuch count ${SEARCH}`"
 
 test_begin_subtest "message count with --output=messages"
 test_expect_equal \
-    "`notmuch search --output=messages ${SEARCH} | wc -l`" \
+    "`notmuch search --output=messages ${SEARCH} | wc -l |sed 's/^[[:space:]]*//'`" \
     "`notmuch count --output=messages ${SEARCH}`"
 
 test_begin_subtest "thread count with --output=threads"
 test_expect_equal \
-    "`notmuch search --output=threads ${SEARCH} | wc -l`" \
+    "`notmuch search --output=threads ${SEARCH} | wc -l |sed 's/^[[:space:]]*//'`" \
     "`notmuch count --output=threads ${SEARCH}`"
 
 test_begin_subtest "thread count is the default for notmuch search"
 test_expect_equal \
-    "`notmuch search ${SEARCH} | wc -l`" \
+    "`notmuch search ${SEARCH} | wc -l |sed 's/^[[:space:]]*//'`" \
     "`notmuch count --output=threads ${SEARCH}`"
 
 SEARCH="from:cworth and not from:cworth"
-- 
1.7.10.2


Thread: