This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Minor refactors to FindExt's test, removing code duplication.
authorNicholas Clark <nick@ccl4.org>
Fri, 14 Jun 2013 09:28:31 +0000 (11:28 +0200)
committerNicholas Clark <nick@ccl4.org>
Tue, 2 Jul 2013 13:33:27 +0000 (15:33 +0200)
Use a ternary instead of if/unless on the same $^O test.
Use a loop to call FindExt::scan_ext()
As FindExt exports nothing, we can require it rather than using it.

t/porting/FindExt.t

index a20acf0..7b95072 100644 (file)
@@ -21,14 +21,13 @@ unless (defined $Config{usedl}) {
 }
 
 plan tests => 12;
-use FindExt;
+require FindExt;
 
 FindExt::apply_config(\%Config);
-FindExt::scan_ext('../cpan');
-FindExt::scan_ext('../dist');
-FindExt::scan_ext('../ext');
-FindExt::set_static_extensions(split ' ', $ENV{PERL_STATIC_EXT}) if $^O eq "MSWin32";
-FindExt::set_static_extensions(split ' ', $Config{static_ext}) unless $^O eq "MSWin32";
+FindExt::scan_ext("../$_")
+    foreach qw(cpan dist ext);
+FindExt::set_static_extensions(split ' ', $^O eq 'MSWin32'
+                               ? $ENV{PERL_STATIC_EXT} : $Config{static_ext});
 
 # Config.pm and FindExt.pm make different choices about what should be built
 my @config_built;