sub license_c2g {
my %seen;
- grep !$seen{$_}++, map @{$licenses{+lc} || []}, @_;
+
+ grep !$seen{$_}++,
+ map @{$licenses{+lc} || []},
+ grep defined,
+ @_;
}
=head2 C<version_c2g $name, $version>
use strict;
use warnings;
-use Test::More tests => 4;
+use Test::More tests => 6;
use CPANPLUS::Dist::Gentoo::Maps;
is_deeply \@licenses, $_[1], $_[2];
}
+check_licenses [ ], [ ], 'empty';
+check_licenses [ undef ], [ ], 'undef';
check_licenses [ 'woo' ], [ ], 'nonexistent';
check_licenses [ 'perl' ], [ qw/Artistic GPL-2/ ], 'perl';
check_licenses [ qw/perl gpl2/ ], [ qw/Artistic GPL-2/ ], 'perl + gpl2';