From ff85fc8d0b3ae88221e20ee9b070c23248eb7921 Mon Sep 17 00:00:00 2001
From: Andrew Dunstan <andrew@dunslane.net>
Date: Wed, 5 Aug 2015 16:19:23 -0400
Subject: [PATCH] Remove carriage returns from certain tap test output under
 Msys

These were causing spurious test failures.
---
 src/test/perl/TestLib.pm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/test/perl/TestLib.pm b/src/test/perl/TestLib.pm
index 8fd6f2c92a8..4927d45d59c 100644
--- a/src/test/perl/TestLib.pm
+++ b/src/test/perl/TestLib.pm
@@ -226,6 +226,7 @@ sub psql
 	print("# Running SQL command: $sql\n");
 	run [ 'psql', '-X', '-A', '-t', '-q', '-d', $dbname, '-f', '-' ], '<', \$sql, '>', \$stdout, '2>', \$stderr or die;
 	chomp $stdout;
+	$stdout =~ s/\r//g if $Config{osname} eq 'msys';
 	return $stdout;
 }
 
@@ -242,7 +243,9 @@ sub slurp_file
 {
 	local $/;
 	local @ARGV = @_;
-	<>
+	my $contents = <>;
+	$contents =~ s/\r//g if $Config{osname} eq 'msys';
+	return $contents;
 }
 
 sub system_or_bail
-- 
GitLab