aboutsummaryrefslogtreecommitdiff
path: root/src/test/perl/PostgresNode.pm
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/perl/PostgresNode.pm')
-rw-r--r--src/test/perl/PostgresNode.pm16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/test/perl/PostgresNode.pm b/src/test/perl/PostgresNode.pm
index 0914fdaa463..8c1b77376fb 100644
--- a/src/test/perl/PostgresNode.pm
+++ b/src/test/perl/PostgresNode.pm
@@ -1512,15 +1512,19 @@ sub psql
}
};
+ # Note: on Windows, IPC::Run seems to convert \r\n to \n in program output
+ # if we're using native Perl, but not if we're using MSys Perl. So do it
+ # by hand in the latter case, here and elsewhere.
+
if (defined $$stdout)
{
- $$stdout =~ s/\r\n/\n/g if $TestLib::windows_os;
+ $$stdout =~ s/\r\n/\n/g if $Config{osname} eq 'msys';
chomp $$stdout;
}
if (defined $$stderr)
{
- $$stderr =~ s/\r\n/\n/g if $TestLib::windows_os;
+ $$stderr =~ s/\r\n/\n/g if $Config{osname} eq 'msys';
chomp $$stderr;
}
@@ -1651,7 +1655,7 @@ sub poll_query_until
{
my $result = IPC::Run::run $cmd, '>', \$stdout, '2>', \$stderr;
- $stdout =~ s/\r\n/\n/g if $TestLib::windows_os;
+ $stdout =~ s/\r\n/\n/g if $Config{osname} eq 'msys';
chomp($stdout);
if ($stdout eq $expected)
@@ -1667,7 +1671,7 @@ sub poll_query_until
# The query result didn't change in 180 seconds. Give up. Print the
# output from the last attempt, hopefully that's useful for debugging.
- $stderr =~ s/\r\n/\n/g if $TestLib::windows_os;
+ $stderr =~ s/\r\n/\n/g if $Config{osname} eq 'msys';
chomp($stderr);
diag qq(poll_query_until timed out executing this query:
$query
@@ -2112,8 +2116,8 @@ sub pg_recvlogical_upto
}
};
- $stdout =~ s/\r\n/\n/g if $TestLib::windows_os;
- $stderr =~ s/\r\n/\n/g if $TestLib::windows_os;
+ $stdout =~ s/\r\n/\n/g if $Config{osname} eq 'msys';
+ $stderr =~ s/\r\n/\n/g if $Config{osname} eq 'msys';
if (wantarray)
{