Re: pgsql: Follow-up fixes for "Make all Perl warnings fatal"

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Follow-up fixes for "Make all Perl warnings fatal"
Date: 2024-01-03 12:14:44
Message-ID: 14c9cb82-46e5-4be0-9233-36d09089dd11@eisentraut.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

On 02.01.24 15:49, Andrew Dunstan wrote:
>
> On 2023-12-29 Fr 17:56, Peter Eisentraut wrote:
>> Follow-up fixes for "Make all Perl warnings fatal"
>>
>> Mostly, we need to check whether $ENV{PG_TEST_EXTRA} is set before
>> doing regular expression matches against it.
>
>
> This reads a bit oddly to me.
>
> -elsif ($ENV{PG_TEST_EXTRA} !~ /\bkerberos\b/)
> +elsif (!$ENV{PG_TEST_EXTRA} || $ENV{PG_TEST_EXTRA} !~ /\bkerberos\b/)
>
> I think I would have changed it like this
>
>   elsif (($ENV{PG_TEST_EXTRA" || "") !~ /\bkerberos\b/)
>
> which is an idiom we've used elsewhere.

I would probably have written it that way, too, but there was already
existing code dealing specifically with PG_TEST_EXTRA that was written
the other way, so I made it match that.

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2024-01-03 12:20:10 pgsql: Make Perl warnings fatal in newly added TAP tests
Previous Message Bharath Rupireddy 2024-01-03 11:21:09 Re: pgsql: Make all Perl warnings fatal