Re: IPC::Run::time[r|out] vs our TAP tests - Mailing list pgsql-hackers

From Daniel Gustafsson
Subject Re: IPC::Run::time[r|out] vs our TAP tests
Date
Msg-id 73CC6454-E4DE-40D3-94FD-ECEBCE9236C6@yesql.se
Whole thread Raw
In response to Re: IPC::Run::time[r|out] vs our TAP tests  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
> On 20 Feb 2025, at 14:06, Andrew Dunstan <andrew@dunslane.net> wrote:

> Actually, since ok() and friends return true iff the test succeeds, instead of
> +    ok(! $self->{timeout}->is_expired, 'psql query_until did not time out');
> +    return undef if $self->{timeout}->is_expired;
> you can avoid doing the same test twice and say:
>      ok(! $self->{timeout}->is_expired, 'psql query_until did not time out') || return undef;
> although for slightly technical reasons perlcritic disapproves of "return undef" and prefers that you just write a
bare"return" so we should also fix that. 
> Sorry for taking a second bite at the cherry.

Not at all, I agree that this is an improvement so fixed in the attached along
with a fresh pgperltidy.

--
Daniel Gustafsson


Attachment

pgsql-hackers by date:

Previous
From: Mahendra Singh Thalor
Date:
Subject: Re: Non-text mode for pg_dumpall
Next
From: Mihail Nikalayeu
Date:
Subject: Re: Revisiting {CREATE INDEX, REINDEX} CONCURRENTLY improvements