Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit590a075

Browse files
committed
Avoid criticizable perl code
Using `require` / `->import` instead of `use` avoids the use of a"stringy eval", making for cleaner code that we don't need to silenceperlcritic about.Per Andrew DunstanDiscussion:https://postgr.es/m/7cd3bbbd-0216-4436-d571-8f80c9259a07@dunslane.net
1 parentd00a4ad commit590a075

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

‎src/test/modules/libpq_pipeline/t/001_libpq_pipeline.pl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@
99
use Test::More;
1010

1111
# Use Test::Differences if installed, and select unified diff output.
12-
# No decent way to select a context line count with this;
13-
# we could use a sub ref to allow that.
1412
BEGIN
1513
{
16-
#<<< protect next line from pgperltidy
17-
if (!evalq{ use Test::Differences; unified_diff(); 1})## no critic (ProhibitStringyEval)
18-
#>>>
19-
{
20-
*eq_or_diff = \&is;
21-
}
14+
eval {
15+
require Test::Differences;
16+
Test::Differences->import;
17+
unified_diff();
18+
};
19+
20+
# No dice -- fall back to 'is'
21+
*eq_or_diff = \&isif$@;
2222
}
2323

2424
my$node = PostgreSQL::Test::Cluster->new('main');

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp