This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Remove BEGIN{}, use '..', part deux
[perl5.git] / t / porting / checkcase.t
1 #!/usr/bin/perl
2 # Finds the files that have the same name, case insensitively,
3 # in the current directory and its subdirectories
4
5 use warnings;
6 use strict;
7 use File::Find;
8
9 my %files;
10 my $test_count = 0;
11
12 find(sub {
13            my $name = $File::Find::name;
14            # Assumes that the path separator is exactly one character.
15            $name =~ s/^\.\..//;
16            push @{$files{lc $name}}, $name;
17          }, '..');
18
19 my $failed;
20
21 foreach (values %files) {
22     if (@$_ > 1) {
23                 print "not ok ".++$test_count. " - ". join(", ", @$_), "\n";
24     } else {
25                 print "ok ".++$test_count. " - ". join(", ", @$_), "\n";
26         }
27 }
28
29 print "1..".$test_count."\n";