Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pa221-0006go-VS for pgsql-committers@arkaria.postgresql.org; Wed, 08 Mar 2023 22:13:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pa220-0004OP-0c for pgsql-committers@arkaria.postgresql.org; Wed, 08 Mar 2023 22:13:08 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pa21z-0004OG-Pd for pgsql-committers@lists.postgresql.org; Wed, 08 Mar 2023 22:13:07 +0000 Received: from relay8-d.mail.gandi.net ([217.70.183.201]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pa21w-0001D8-MG for pgsql-committers@lists.postgresql.org; Wed, 08 Mar 2023 22:13:07 +0000 Received: (Authenticated sender: adsend@dunslane.net) by mail.gandi.net (Postfix) with ESMTPSA id 0B9381BF204; Wed, 8 Mar 2023 22:13:01 +0000 (UTC) Message-ID: <7cd3bbbd-0216-4436-d571-8f80c9259a07@dunslane.net> Date: Wed, 8 Mar 2023 17:13:00 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: pgsql: 001_libpq_pipeline.pl: use Test::Differences if available Content-Language: en-US To: Alvaro Herrera , pgsql-committers@lists.postgresql.org References: From: Andrew Dunstan In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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 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