forked from Perl-Toolchain-Gang/Software-License
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
38 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,32 @@ | |||
#!perl | |||
use strict; | |||
use warnings; | |||
use Test::More; | |||
|
|||
use Software::License; | |||
use Software::LicenseUtils; | |||
|
|||
my @round_trippable = qw( | |||
AGPL_3 | |||
Artistic_1_0 Artistic_2_0 | |||
BSD | |||
GPL_1 GPL_2 GPL_3 | |||
LGPL_2_1 LGPL_3_0 | |||
MIT | |||
Perl_5 | |||
); | |||
|
|||
plan tests => 2 * @round_trippable; | |||
|
|||
for my $name (@round_trippable) { | |||
my $class = "Software::License::$name"; | |||
eval "require $class; 1" or die $@; | |||
my $notice = $class->new({ holder => 'J. Phred Bloggs' })->notice; | |||
my $pod = "=head1 LEGAL\n\n$notice\n\n=cut\n"; | |||
|
|||
my @guess = Software::LicenseUtils->guess_license_from_pod($pod); | |||
|
|||
is(@guess, 1, "$name: only 1 guess for license we build") | |||
or diag "guesses: @guess"; | |||
is($guess[0], $class, "$name: ...and we got it right"); | |||
} |