summaryrefslogtreecommitdiff
path: root/src/test/perl/PostgreSQL/Test/Cluster.pm
diff options
context:
space:
mode:
authorNoah Misch <noah@leadboat.com>2022-06-25 09:07:44 -0700
committerNoah Misch <noah@leadboat.com>2022-06-25 09:07:44 -0700
commit20911775de4ab7ac3ecc68bd714cb3ed0fd68b6a (patch)
treedf915f21e75ee5e717bf096de381e7f17eb15234 /src/test/perl/PostgreSQL/Test/Cluster.pm
parent3238b5c330bc384441473dd2859845c27d9ade2f (diff)
For PostgreSQL::Test compatibility, alias entire package symbol tables.
Remove the need to edit back-branch-specific code sites when back-patching the addition of a PostgreSQL::Test::Utils symbol. Replace per-symbol, incomplete alias lists. Give old and new package names the same EXPORT and EXPORT_OK semantics. Back-patch to v10 (all supported versions). Reviewed by Andrew Dunstan. Discussion: https://postgr.es/m/20220622072144.GD4167527@rfd.leadboat.com
Diffstat (limited to 'src/test/perl/PostgreSQL/Test/Cluster.pm')
-rw-r--r--src/test/perl/PostgreSQL/Test/Cluster.pm9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/test/perl/PostgreSQL/Test/Cluster.pm b/src/test/perl/PostgreSQL/Test/Cluster.pm
index 12339c23de1..14b8ee73776 100644
--- a/src/test/perl/PostgreSQL/Test/Cluster.pm
+++ b/src/test/perl/PostgreSQL/Test/Cluster.pm
@@ -1,9 +1,9 @@
# Copyright (c) 2022, PostgreSQL Global Development Group
-# allow use of release 15+ perl namespace in older branches
-# just 'use' the older module name.
-# See PostgresNode.pm for function implementations
+# Allow use of release 15+ Perl package name in older branches, by giving that
+# package the same symbol table as the older package. See PostgresNode::new
+# for supporting heuristics.
package PostgreSQL::Test::Cluster;
@@ -11,5 +11,8 @@ use strict;
use warnings;
use PostgresNode;
+BEGIN { *PostgreSQL::Test::Cluster:: = \*PostgresNode::; }
+
+use Exporter 'import';
1;