summaryrefslogtreecommitdiff
path: root/src/test/perl/TestLib.pm
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2020-07-09 17:38:52 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2020-07-09 17:38:52 -0400
commitd0390509a1823d5cb29ae3ed7cbbedf8684d3d6c (patch)
tree363eacf68d169e2017bd0277c6a76093fc4e0f42 /src/test/perl/TestLib.pm
parente3ed833e0c566c106b00b9a0728bc2cb1db8161a (diff)
Tighten up Windows CRLF conversion in our TAP test scripts.
Back-patch commits 91bdf499b and ffb4cee43, so that all branches agree on when and how to do Windows CRLF conversion. This should close the referenced thread. Thanks to Andrew Dunstan for discussion/review. Discussion: https://postgr.es/m/412ae8da-76bb-640f-039a-f3513499e53d@gmx.net
Diffstat (limited to 'src/test/perl/TestLib.pm')
-rw-r--r--src/test/perl/TestLib.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/test/perl/TestLib.pm b/src/test/perl/TestLib.pm
index b2c536b044a..b606e1b173f 100644
--- a/src/test/perl/TestLib.pm
+++ b/src/test/perl/TestLib.pm
@@ -259,8 +259,8 @@ sub psql
my ($stdout, $stderr);
print("# Running SQL command: $sql\n");
run [ 'psql', '-X', '-A', '-t', '-q', '-d', $dbname, '-f', '-' ], '<', \$sql, '>', \$stdout, '2>', \$stderr or die;
+ $stdout =~ s/\r\n/\n/g if $Config{osname} eq 'msys';
chomp $stdout;
- $stdout =~ s/\r//g if $Config{osname} eq 'msys';
return $stdout;
}
@@ -281,7 +281,7 @@ sub slurp_file
or die "could not read \"$filename\": $!";
my $contents = <$in>;
close $in;
- $contents =~ s/\r//g if $Config{osname} eq 'msys';
+ $contents =~ s/\r\n/\n/g if $Config{osname} eq 'msys';
return $contents;
}