forked from metacpan/CPAN-Changes
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle the case where a change starts with no leading whitespace, and…
… still parse continuation lines correctly.
- Loading branch information
Showing
3 changed files
with
39 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,3 @@ | |||
0.01 2010-06-16 | |||
- Initial release | |||
This line is part of the first |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,31 @@ | |||
use strict; | |||
use warnings; | |||
|
|||
use Test::More; | |||
|
|||
use_ok( 'CPAN::Changes' ); | |||
|
|||
my $changes = CPAN::Changes->load( 't/corpus/no-leading-space-for-change.changes' ); | |||
|
|||
isa_ok( $changes, 'CPAN::Changes' ); | |||
is( $changes->preamble, '', 'no preamble' ); | |||
|
|||
my @releases = $changes->releases; | |||
|
|||
is( scalar @releases, 1, 'has 1 release' ); | |||
isa_ok( $releases[ 0 ], 'CPAN::Changes::Release' ); | |||
is( $releases[ 0 ]->version, '0.01', 'version' ); | |||
is( $releases[ 0 ]->date, '2010-06-16', 'date' ); | |||
is_deeply( | |||
$releases[ 0 ]->changes, | |||
{ '' => [ "Initial release This line is part of the first" ] }, | |||
'full changes' | |||
); | |||
is_deeply( [ $releases[ 0 ]->groups ], [ '' ], 'only the main group' ); | |||
is_deeply( | |||
$releases[ 0 ]->changes( '' ), | |||
[ "Initial release This line is part of the first" ], | |||
'one change line' | |||
); | |||
|
|||
done_testing; |