From adede1cdbfb291b7f8dee95da22884f2d465056e Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Fri, 14 Jun 2013 11:28:31 +0200 Subject: Minor refactors to FindExt's test, removing code duplication. 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 | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 't') diff --git a/t/porting/FindExt.t b/t/porting/FindExt.t index a20acf09aa..7b950725a8 100644 --- a/t/porting/FindExt.t +++ b/t/porting/FindExt.t @@ -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; -- cgit v1.2.1