Re: [PATCH v3 1/5] test: use bash specific test for feature tests

Subject: Re: [PATCH v3 1/5] test: use bash specific test for feature tests

Date: Thu, 13 Apr 2023 21:56:57 +0300

To: Felipe Contreras, David Bremner

Cc: notmuch@notmuchmail.org

From: Tomi Ollila


On Thu, Apr 13 2023, Felipe Contreras wrote:

> On Sun, Apr 9, 2023 at 9:26 AM David Bremner <david@tethera.net> wrote:
>>
>> It is desirable to have the tests consider these variables being
>> undefined as equivalent to the feature not being present, and in
>> particular for the tests not to generate errors.
>
> This can be done easily with `[ ${FOO-0} -eq 1 ]`, or as I prefer: `[
> "$FOO" = 1 ]`.

[ "${FOO-0}" = 1 ]

if $FOO is to have $IFS characters...

Tomi

>
> -- 
> Felipe Contreras
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: