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
This commit is contained in:
Andrew Dunstan 2024-01-30 17:09:44 -05:00
parent 8ee9c25087
commit 6ee26c6a4b
1 changed files with 13 additions and 0 deletions

View File

@ -78,6 +78,19 @@ sub run_test
},
$test_primary_datadir);
@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(
\@paths,
[