Fix 003_extrafiles.pl test for the Windows

File::Find converts backslashes to slashes in the newer Perl versions.
See: 414f14df98

So, do the same conversion for Windows before comparing paths. To
support all Perl versions, always convert them on Windows regardless of
the Perl's version.

Author: Nazir Bilal Yavuz <byavuz81@gmail.com>

Backpatch to all live branches
REL_16_STABLE
Andrew Dunstan 2 years ago
parent 5d726c72cd
commit 52a9af3b8b
  1. 13
      src/bin/pg_rewind/t/003_extrafiles.pl

@ -78,6 +78,19 @@ sub run_test
}, },
$test_primary_datadir); $test_primary_datadir);
@paths = sort @paths; @paths = sort @paths;
# File::Find converts backslashes to slashes in the newer Perl
# versions. To support all Perl versions, do the same conversion
# for Windows before comparing the paths.
if ($PostgreSQL::Test::Utils::windows_os)
{
for my $filename (@paths)
{
$filename =~ s{\\}{/}g;
}
$test_primary_datadir =~ s{\\}{/}g;
}
is_deeply( is_deeply(
\@paths, \@paths,
[ [

Loading…
Cancel
Save