3
use Test::More tests => 2;
5
note 'Checking Changes';
6
my $changes_file = 'Changes';
7
my $newver = '0.100051';
8
my $trial_token = '-TRIAL';
11
ok(-e $changes_file, "$changes_file file exists")
12
or skip 'Changes is missing', 1;
14
ok(_get_changes($newver), "$changes_file has content for $newver");
19
# _get_changes copied and adapted from Dist::Zilla::Plugin::Git::Commit
25
# parse changelog to find commit message
26
open(my $fh, '<', $changes_file) or die "cannot open $changes_file: $!";
27
my $changelog = join('', <$fh>);
31
grep { /^$newver(?:$trial_token)?(?:\s+|$)/ ... /^\S/ } # from newver to un-indented
32
split /\n/, $changelog;
33
shift @content; # drop the version line
35
# drop unindented last line and trailing blank lines
36
pop @content while ( @content && $content[-1] =~ /^(?:\S|\s*$)/ );
38
# return number of non-blank lines
39
return scalar @content;