File: parse.t

package info (click to toggle)
libcpan-changes-perl 0.500005-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,964 kB
  • sloc: perl: 988; makefile: 2
file content (40 lines) | stat: -rw-r--r-- 908 bytes parent folder | download
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
use strict;
use warnings;
use Test::More;

use CPAN::Changes::Parser;

my $parser = CPAN::Changes::Parser->new;

my $changes = $parser->parse_file('corpus/dists/DBIx-Class.changes');

is $changes->preamble, 'Revision history for DBIx::Class';
is scalar @{[ $changes->releases ]}, 114;

my $release = $changes->find_release(0.08260);

ok $release;

is_deeply [ map { $_->text } @{ $release->entries } ], [
  'New Features',
  'Notable Changes and Deprecations',
  'Fixes',
  'Misc',
];

$release = $changes->find_release(0.08250);
my $entry = $release
  ->find_entry('New Features / Changes')
  ->find_entry(qr/^Rewrite from scratch the result/);

ok $entry;

is scalar @{ $entry->entries }, 7;

ok $changes->find_release('v0.82.600');
ok $changes->find_release('0.82.600');
ok $changes->find_release('0.82.600');
ok $changes->find_release(0.08099_08);
ok $changes->find_release("0.08099_08");

done_testing;