diff options
author | Nicholas Clark <nick@ccl4.org> | 2013-06-17 10:19:48 +0200 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2013-07-02 15:33:27 +0200 |
commit | ef04dc3ea7996faa32bab00ea42b66d7f7901e59 (patch) | |
tree | b4940df14363a5d4ce1ce829fc869f8c147757a6 /t/porting/FindExt.t | |
parent | adede1cdbfb291b7f8dee95da22884f2d465056e (diff) | |
download | perl-ef04dc3ea7996faa32bab00ea42b66d7f7901e59.tar.gz |
In FindExt.t, move the main loop's comparison logic into a subroutine.
Diffstat (limited to 't/porting/FindExt.t')
-rw-r--r-- | t/porting/FindExt.t | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/t/porting/FindExt.t b/t/porting/FindExt.t index 7b950725a8..f690b4a360 100644 --- a/t/porting/FindExt.t +++ b/t/porting/FindExt.t @@ -29,6 +29,15 @@ FindExt::scan_ext("../$_") FindExt::set_static_extensions(split ' ', $^O eq 'MSWin32' ? $ENV{PERL_STATIC_EXT} : $Config{static_ext}); +sub compare { + my ($desc, $want, @have) = @_; + $want = [sort split ' ', $want] + unless ref $want eq 'ARRAY'; + local $::Level = $::Level + 1; + is(scalar @have, scalar @$want, "We find the same number of $desc"); + is("@have", "@$want", "We find the same list of $desc"); +} + # Config.pm and FindExt.pm make different choices about what should be built my @config_built; my @found_built; @@ -52,13 +61,10 @@ foreach (['dynamic_ext', ['"config" dynamic + static + nonxs', \@config_built, $Config{extensions}], ['"found" dynamic + static + nonxs', - \@found_built, join " ", FindExt::extensions()], + \@found_built, [FindExt::extensions()]], ) { my ($type, $found, $config) = @$_; - my @config = sort split ' ', $config; - is (scalar @$found, scalar @config, - "We find the same number of $type"); - is ("@$found", "@config", "We find the same list of $type"); + compare($type, $config, @$found); } # Local variables: |