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

Commit2f15771

Browse files
authored
Merge pull request#15 from postgrespro/PGPRO-5983
PGPRO-5983: fix Perl tests due to changes in PostgreSQL 15devel
2 parentsb5d2c58 +838a560 commit2f15771

File tree

1 file changed

+37
-10
lines changed

1 file changed

+37
-10
lines changed

‎t/001_basic.pl

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,52 @@
66

77
use strict;
88
use warnings;
9-
use PostgresNode;
10-
use TestLib;
119
use Test::More;
1210

11+
my$pg_15_modules;
12+
13+
BEGIN
14+
{
15+
$pg_15_modules =eval
16+
{
17+
require PostgreSQL::Test::Cluster;
18+
require PostgreSQL::Test::Utils;
19+
return 1;
20+
};
21+
22+
unless (defined$pg_15_modules)
23+
{
24+
$pg_15_modules = 0;
25+
26+
require PostgresNode;
27+
require TestLib;
28+
}
29+
}
30+
1331
plantests=> 24;
1432

33+
note('PostgreSQL 15 modules are used:' . ($pg_15_modules ?'yes' :'no'));
34+
1535
my$node;
1636
my$res;
1737
my$res_stdout;
1838
my$res_stderr;
1939

20-
# Initialize 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-
}
40+
# Create node.
41+
# Older versions of PostgreSQL modules use get_new_node function.
42+
# Newer use standard perl object constructor syntax.
43+
eval
44+
{
45+
if ($pg_15_modules)
46+
{
47+
$node = PostgreSQL::Test::Cluster->new("node");
48+
}
49+
else
50+
{
51+
$node = PostgresNode::get_new_node("node");
52+
}
53+
};
54+
2855
$node->init;
2956
$node->start;
3057

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp