Skip to content

Commit

Permalink
add test to make sure MANIFEST contains all the libs
Browse files Browse the repository at this point in the history
  • Loading branch information
DrHyde committed Nov 12, 2020
1 parent a62db69 commit 6d88e35
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 7 deletions.
16 changes: 9 additions & 7 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,20 @@ WriteMakefile(
},

PREREQ_PM => {
'Scalar::Util' => 1.48,
'Test::More' => '0.96', # need done_testing (0.88) and subtests (0.95_01)
'Digest::MD5' => 0,
'Cwd' => 0,
'DBM::Deep' => 2.0008,
'Devel::CheckOS' => '1.83',
'Test::utf8' => 0,
'Digest::MD5' => 0,
'File::Basename' => 0,
'File::Find::Rule' => 0,
'File::ShareDir' => 1.104,
'File::Spec' => 0,
'File::Basename' => 0,
'Cwd' => 0,
'I18N::LangTags::Detect' => 0,
'I18N::LangTags' => 0,
'I18N::LangTags::Detect' => 0,
'Scalar::Util' => 1.48,
'Test::Differences' => 0.62,
'Test::More' => '0.96', # need done_testing (0.88) and subtests (0.95_01)
'Test::utf8' => 0,
},
dist => {
PREOP => "./build-data.sh --previoustag"
Expand Down
20 changes: 20 additions & 0 deletions t/manifest-contains-all-modules.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
use strict;
use warnings;

use File::Find::Rule;

use Test::More;
use Test::Differences;

open(my $manifest_fh, '<', 'MANIFEST') || die("Couldn't open MANIFEST: $!\n");
my @manifest = sort grep { /^lib.*\.pm$/ } map { chomp; $_ } <$manifest_fh>;
my @files = sort File::Find::Rule->file()->name('*.pm')->in('lib');

eq_or_diff(
\@manifest,
\@files,
"MANIFEST and lib/**/*.pm match",
{ filename_a => 'MANIFEST', filename_b => 'lib/**/*.pm' }
);

done_testing();

0 comments on commit 6d88e35

Please sign in to comment.