Skip to content

Commit 2a4e335

Browse files
committed
Support PostgresNode->new along with get_new_node in tests
PostgreSQL recently dropped nonstandard way of create PostgesNode object - function get_new_node exported from the PostgresNode module. Now it is recommended to use PostgresNode->new constructor call This commit supports both ways of node creation - if get_new_node exists, use it, otherwice all constructor directly.
1 parent 6f1a27b commit 2a4e335

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Diff for: t/001_basic.pl

+7-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,13 @@
1818
my $res_stderr;
1919

2020
# Initialize node
21-
$node = get_new_node('node');
21+
# Older version of PostgresNode.pm use get_new_node function.
22+
# Newer use standard perl object constructor syntax
23+
if (PostgresNode->can('get_new_node')) {
24+
$node = get_new_node('node');
25+
} else {
26+
$node = PostgresNode->new("node");
27+
}
2228
$node->init;
2329
$node->start;
2430

0 commit comments

Comments
 (0)