This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
make setpgrpstack.t use skip_all_without_config
[perl5.git] / t / porting / checkcase.t
CommitLineData
772ab650
JM
1#!/usr/bin/perl
2# Finds the files that have the same name, case insensitively,
3# in the current directory and its subdirectories
4
5use warnings;
6use strict;
7use File::Find;
8
9my %files;
bf61c852
JV
10my $test_count = 0;
11
772ab650 12find(sub {
d7bdb612
DG
13 # We only care about directories to the extent they
14 # result in an actual file collision, so skip dirs
15 return if -d $File::Find::name;
f86fc3ff 16
d7bdb612
DG
17 my $name = $File::Find::name;
18 # Assumes that the path separator is exactly one character.
19 $name =~ s/^\.\..//;
0a38ae18 20
d7bdb612
DG
21 # Special exemption for Makefile, makefile
22 return if $name =~ m!\A(?:x2p/)?[Mm]akefile\z!;
0a38ae18 23
d7bdb612
DG
24 push @{$files{lc $name}}, $name;
25 }, '..');
772ab650 26
0f7807cd 27foreach (sort values %files) {
772ab650 28 if (@$_ > 1) {
d7bdb612
DG
29 print "not ok ".++$test_count. " - ". join(", ", @$_), "\n";
30 print STDERR "# $_\n" foreach @$_;
bf61c852 31 } else {
d7bdb612
DG
32 print "ok ".++$test_count. " - ". join(", ", @$_), "\n";
33 }
772ab650
JM
34}
35
bf61c852 36print "1..".$test_count."\n";
d7bdb612 37# vim: ts=4 sts=4 sw=4 et: