Re: pgsql: Skip \password TAP test on old IPC::Run versions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Daniel Gustafsson <daniel(at)yesql(dot)se>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Skip \password TAP test on old IPC::Run versions
Date: 2023-04-08 20:30:00
Message-ID: 3618405.1680985800@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Daniel Gustafsson <daniel(at)yesql(dot)se> writes:
> On 8 Apr 2023, at 18:23, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> Can't we write "use IPC::Run 0.98;" and let
>> some other code manage the version comparison?

> We can, but that AFAIK (Andrew might have a better answer) requires the below
> diff which I think leaves some readability to be desired:

> - (eval { require IO::Pty; } && eval { $IPC::Run::VERSION >= '0.98' });
> + (eval { require IO::Pty; } && !!eval { IPC::Run->VERSION('0.98'); 1 });

Maybe I'm missing something, but I was envisioning

eval { require IO::Pty; use IPC::Run 0.98; }

with no need to do more than check if the eval traps an error.

regards, tom lane

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Thomas Munro 2023-04-08 20:36:46 pgsql: Use higher wal_level for 004_io_direct.pl.
Previous Message Daniel Gustafsson 2023-04-08 20:20:30 Re: pgsql: Skip \password TAP test on old IPC::Run versions