-
-
Save anonymous/7cbc2b430ec29644af02 to your computer and use it in GitHub Desktop.
Testcase showing redefinition warning not being caught
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl -w | |
use File::Find; | |
use File::Spec; | |
use Test::More; | |
use Test::NoWarnings; | |
use warnings FATAL => qw(all); | |
my @files; | |
File::Find::find( | |
sub | |
{ | |
if (/\.pm$/ && $File::Find::dir) | |
{ | |
push(@files, $File::Find::name); | |
} | |
}, | |
"." | |
); | |
done_testing(scalar(@files) + 1); # Test::NoWarnings adds an implicit test case | |
foreach my $file (@files) | |
{ | |
my $path = File::Spec->canonpath($file); | |
my $includeString = "$file"; | |
if ($path =~ /(.*)\.pm/) | |
{ | |
my $relativePath = $1; | |
my @subPath = split /\\/, $relativePath; | |
$includeString = join '::', @subPath; | |
} | |
use_ok($includeString); | |
} | |
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package MyFailure1; | |
use strict; | |
use warnings; | |
use base 'Exporter'; | |
our @EXPORT = qw(duplicateFunction); | |
sub duplicateFunction | |
{ | |
return; | |
} | |
1; | |
__END__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package MyFailure2; | |
use strict; | |
use warnings; | |
use base 'Exporter'; | |
our @EXPORT = qw(duplicateFunction); | |
sub duplicateFunction | |
{ | |
return; | |
} | |
1; | |
__END__ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment