File: coverage-perl.t

package info (click to toggle)
libregexp-pattern-license-perl 3.11.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 1,580 kB
  • sloc: perl: 12,506; makefile: 2; sh: 1
file content (50 lines) | stat: -rw-r--r-- 1,893 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
use Test2::V0;

plan 1;

use Regexp::Pattern::License;

my %RE = %Regexp::Pattern::License::RE;

my %names = map {
	$RE{$_}{'name.alt.org.perl.synth.nogrant'}
		// $RE{$_}{'name.alt.org.perl'} =>
		$RE{$_}{'caption.alt.org.perl.synth.nogrant'}
		// $RE{$_}{'caption.alt.org.perl'} // $RE{$_}{caption}
	}
	grep {
	grep {/^name\.alt\.org\.perl(?:\.synth\.nogrant)?$/}
		keys %{ $RE{$_} }
	}
	keys %RE;

is \%names, hash {
	field agpl_3      => 'GNU Affero General Public License, Version 3';
	field apache_1_1  => 'Apache Software License, Version 1.1';
	field apache_2_0  => 'Apache License, Version 2.0';
	field artistic_1  => 'Artistic License, (Version 1)';
	field artistic_2  => 'Artistic License, Version 2.0';
	field bsd         => 'BSD License (three-clause)';
	field freebsd     => 'FreeBSD License (two-clause)';
	field gfdl_1_2    => 'GNU Free Documentation License, Version 1.2';
	field gfdl_1_3    => 'GNU Free Documentation License, Version 1.3';
	field gpl_1       => 'GNU General Public License, Version 1';
	field gpl_2       => 'GNU General Public License, Version 2';
	field gpl_3       => 'GNU General Public License, Version 3';
	field lgpl_2_1    => 'GNU Lesser General Public License, Version 2.1';
	field lgpl_3_0    => 'GNU Lesser General Public License, Version 3.0';
	field mit         => 'MIT (aka X11) License';
	field mozilla_1_0 => 'Mozilla Public License, Version 1.0';
	field mozilla_1_1 => 'Mozilla Public License, Version 1.1';
	field openssl     => 'OpenSSL License';
	field perl_5      => 'The Perl 5 License (Artistic 1 & GPL 1 or later)';
	field qpl_1_0     => 'Q Public License, Version 1.0';
	field ssleay      => 'Original SSLeay License';
	field sun         => 'Sun Internet Standards Source License (SISSL)';
	field zlib        => 'zlib License';

	end();
}, 'coverage of <https://metacpan.org/pod/CPAN::Meta::Spec#license>',
	\%names;

done_testing;