Re: pgsql: 001_libpq_pipeline.pl: use Test::Differences if available
От | Andrew Dunstan |
---|---|
Тема | Re: pgsql: 001_libpq_pipeline.pl: use Test::Differences if available |
Дата | |
Msg-id | 7cd3bbbd-0216-4436-d571-8f80c9259a07@dunslane.net обсуждение исходный текст |
Ответ на | pgsql: 001_libpq_pipeline.pl: use Test::Differences if available (Alvaro Herrera <alvherre@alvh.no-ip.org>) |
Ответы |
Re: pgsql: 001_libpq_pipeline.pl: use Test::Differences if available
|
Список | pgsql-committers |
On 2023-03-08 We 12:42, Alvaro Herrera wrote: > 001_libpq_pipeline.pl: use Test::Differences if available > > When one of these tests fails to match the trace, this better shows what > the problem is. > > Discussion: https://postgr.es/m/20220617183150.ilgokxp22mzywnhh@alvherre.pgsql > Reviewed-by: Kyotaro Horiguchi <horikyota.ntt@gmail.com> I don't think you need a stringy eval here, and they are something to be avoided in general. If you use `require` instead of `use` it should be unnecessary, and you can avoid all the perltidy ugliness. something like this should do the trick: eval { require Test::Differences; Test::Differences->import; unified_diff; 1; }; *eq_or_diff = \&is if $@; I wonder if it's worth centralizing this. cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com
В списке pgsql-committers по дате отправления: