Skip to content

Commit

Permalink
test to show the identifier block managling bug as reported in
Browse files Browse the repository at this point in the history
rt.cpan.org ticket #78043
https://rt.cpan.org/Ticket/Display.html?id=78043

Example text was taken from the perl.pl file supplied by the bug
reporter, <finn@timeghost.net>.
  • Loading branch information
jhoblitt committed Aug 3, 2012
1 parent b25d1b4 commit 8d91778
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
13 changes: 12 additions & 1 deletion t/02_pod_wrap_pretty.t
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use warnings FATAL => qw( all );

use lib qw( ./lib ./t );

use Test::More tests => 2;
use Test::More tests => 3;

use IO::String;
use Pod::Wrap::Pretty;
Expand All @@ -34,3 +34,14 @@ use Test::Pod::Tidy;

is(${$output->string_ref}, $POD_WS_TRIMMED, "test ws tail trimming");
}

{
my $input = IO::String->new($POD_IDENTIFIER_BLOCK);
my $output = IO::String->new;

my $w = Pod::Wrap::Pretty->new;

$w->parse_from_filehandle($input, $output);

is(${$output->string_ref}, $POD_IDENTIFIER_BLOCK, "test identifier block non-mangling");
}
27 changes: 27 additions & 0 deletions t/Test/Pod/Tidy.pm
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ use vars qw(
$INVALID_POD
$POD_WS_TAIL
$POD_WS_TRIMMED
$POD_IDENTIFIER_BLOCK
);

@EXPORT = qw(
Expand All @@ -26,6 +27,7 @@ use vars qw(
$INVALID_POD
$POD_WS_TAIL
$POD_WS_TRIMMED
$POD_IDENTIFIER_BLOCK
);

$MESSY_POD = encode( Native =><<END );
Expand Down Expand Up @@ -139,6 +141,31 @@ C source tests are usually located in F<t/src/*.t>. A simple test looks like:
=cut
END

# this block of text should not be modified by processing
$POD_IDENTIFIER_BLOCK = encode( Native =><<END );
=head3 B<list>
Return a list of data.
=begin return_value
[{
"id": 3,
"start_date": "2011-10-01 00:00:00",
"end_date": "2011-10-03 00:00:00",
"name": "A Name",
}, {
"id": 5,
"start_date": "2011-09-01 00:00:00",
"end_date": "2011-09-03 00:00:00",
"name": "Another Name",
}]
=end return_value
=cut
END

1;

__END__

0 comments on commit 8d91778

Please sign in to comment.