File: read_unknown_date.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 (31 lines) | stat: -rw-r--r-- 847 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
use strict;
use warnings;

use Test::More;

use CPAN::Changes;

my $changes = CPAN::Changes->load( 'corpus/test/legacy/unknown_date.changes' );

isa_ok( $changes, 'CPAN::Changes' );
is( $changes->preamble, '', 'no preamble' );

my @releases = $changes->releases;

is( scalar @releases, 5, 'has 5 releases' );

my @expected = (
    { version => '0.01', date => 'Unknown' },
    { version => '0.02', date => 'Not Released' },
    { version => '0.03', date => 'Unknown Release Date' },
    { version => '0.04', date => 'Development Release' },
    { version => '0.05', date => 'Developer Release' },
);

for ( 0..@expected - 1 ) {
    isa_ok( $releases[ $_ ], 'CPAN::Changes::Release' );
    is( $releases[ $_ ]->version, $expected[ $_ ]->{ version }, 'version' );
    is( $releases[ $_ ]->date, $expected[ $_ ]->{ date }, 'date' );
}

done_testing;