Commit | Line | Data |
772ab650 |
1 | #!/usr/bin/perl |
2 | # Finds the files that have the same name, case insensitively, |
3 | # in the current directory and its subdirectories |
4 | |
bf61c852 |
5 | BEGIN { |
6 | chdir 't' if -d 't'; |
7 | @INC = '../lib'; |
8 | } |
9 | |
10 | |
11 | |
772ab650 |
12 | use warnings; |
13 | use strict; |
14 | use File::Find; |
15 | |
16 | my %files; |
bf61c852 |
17 | my $test_count = 0; |
18 | |
772ab650 |
19 | find(sub { |
20 | my $name = $File::Find::name; |
21 | # Assumes that the path separator is exactly one character. |
22 | $name =~ s/^\.\..//; |
23 | push @{$files{lc $name}}, $name; |
24 | }, '.'); |
25 | |
26 | my $failed; |
27 | |
28 | foreach (values %files) { |
29 | if (@$_ > 1) { |
bf61c852 |
30 | print "not ok ".++$test_count. " - ". join(", ", @$_), "\n"; |
31 | } else { |
32 | print "ok ".++$test_count. " - ". join(", ", @$_), "\n"; |
33 | } |
772ab650 |
34 | } |
35 | |
bf61c852 |
36 | print "1..".$test_count."\n"; |