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

Peter Wang novalazy at gmail.com
Fri May 25 19:42:02 PDT 2012


On Fri, 25 May 2012 09:43:27 -0400, Mike Kelly <pioto at pioto.org> wrote:
> 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}`"

You could perform a proper integer comparison like:

test_expect_success "message count is the default for notmuch count" '
    test "`notmuch search --output=messages ${SEARCH} | wc -l`" \
     -eq "`notmuch count ${SEARCH}`"
'

Peter


More information about the notmuch mailing list