Debian Codegraph @

xt/99-changes.t

raw
1 #!perl -w
2 use warnings;
3 use strict;
4 use File::Find;
5 use Test::More tests => 2;
6
7 =head1 PURPOSE
8
9 This test ensures that the Changes file
10 mentions the current version and that a
11 release date is mentioned as well
12
13 =cut
14
15 require './Makefile.PL';
16 # Loaded from Makefile.PL
17 our %module = get_module_info();
18 my $module = $module{NAME};
19
20 (my $file = $module) =~ s!::!/!g;
21 require "$file.pm";
22
23 my $version = sprintf '%0.2f', $module->VERSION;
24
25 my $changes = do { local $/; open my $fh, 'Changes' or die $!; <$fh> };
26
27 ok $changes =~ /^(.*$version.*)$/m, "We find version $version for $module";
28 my $changes_line = $1;
29 ok $changes_line =~ /$version\s+20\d\d-[01]\d-[0123]\d\b/, "We find a release date on the same line"
30 or diag $changes_line;