diff options
author | Andrew Dunstan <andrew@dunslane.net> | 2021-10-24 10:28:19 -0400 |
---|---|---|
committer | Andrew Dunstan <andrew@dunslane.net> | 2021-10-24 10:28:19 -0400 |
commit | b3b4d8e68ae83f432f43f035c7eb481ef93e1583 (patch) | |
tree | ff4e73500b61f2235bd4e3822d8e1a1af3a37523 /src/test/perl/SimpleTee.pm | |
parent | 3cd9c3b921977272e6650a5efbeade4203c4bca2 (diff) | |
download | postgresql-b3b4d8e68ae83f432f43f035c7eb481ef93e1583.tar.gz postgresql-b3b4d8e68ae83f432f43f035c7eb481ef93e1583.zip |
Move Perl test modules to a better namespace
The five modules in our TAP test framework all had names in the top
level namespace. This is unwise because, even though we're not
exporting them to CPAN, the names can leak, for example if they are
exported by the RPM build process. We therefore move the modules to the
PostgreSQL::Test namespace. In the process PostgresNode is renamed to
Cluster, and TestLib is renamed to Utils. PostgresVersion becomes simply
PostgreSQL::Version, to avoid possible confusion about what it's the
version of.
Discussion: https://postgr.es/m/aede93a4-7d92-ef26-398f-5094944c2504@dunslane.net
Reviewed by Erik Rijkers and Michael Paquier
Diffstat (limited to 'src/test/perl/SimpleTee.pm')
-rw-r--r-- | src/test/perl/SimpleTee.pm | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/src/test/perl/SimpleTee.pm b/src/test/perl/SimpleTee.pm deleted file mode 100644 index 681a36a0f8e..00000000000 --- a/src/test/perl/SimpleTee.pm +++ /dev/null @@ -1,35 +0,0 @@ - -# Copyright (c) 2021, PostgreSQL Global Development Group - -# A simple 'tee' implementation, using perl tie. -# -# Whenever you print to the handle, it gets forwarded to a list of -# handles. The list of output filehandles is passed to the constructor. -# -# This is similar to IO::Tee, but only used for output. Only the PRINT -# method is currently implemented; that's all we need. We don't want to -# depend on IO::Tee just for this. - -package SimpleTee; -use strict; -use warnings; - -sub TIEHANDLE -{ - my $self = shift; - return bless \@_, $self; -} - -sub PRINT -{ - my $self = shift; - my $ok = 1; - for my $fh (@$self) - { - print $fh @_ or $ok = 0; - $fh->flush or $ok = 0; - } - return $ok; -} - -1; |