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 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
|
use strict;
use warnings;
use Test::More tests => 1;
use Pod::Eventual::Simple;
my $output = Pod::Eventual::Simple->read_file('eg/test.pod');
my @events = grep { $_->{type} ne 'nonpod' and $_->{type} ne 'blank' }
@$output;
my $want = [
{
type => 'command',
command => 'pod',
content => "\nsay 3;\n",
start_line => 4,
},
{
type => 'command',
command => 'cut',
content => "\n",
start_line => 6,
},
{
type => 'command',
command => 'head1',
content => "NAME\n",
start_line => 10,
},
{
type => 'text',
content => "This is a test of the NAME header.\n",
start_line => 12,
},
{
type => 'command',
command => 'head2',
content => "Extended\n"
. "This is all part of the head2 para, whether you believe it or not.\n",
start_line => 14,
},
{
type => 'text',
content => "Then we're in a normal text paragraph.\n",
start_line => 17,
},
{
type => 'text',
content => "Still normal!\n",
start_line => 19,
},
{
type => 'text',
content => " This one is verbatim.\n",
start_line => 21,
},
{
type => 'text',
content => "Then back to normal.\n",
start_line => 23,
},
{
type => 'text',
content => " And then verbatim\n"
. "Including a secondary unindented line. Oops! Should still work.\n",
start_line => 25,
},
{
type => 'command',
command => 'cut',
content => "\n",
start_line => 27,
},
];
is_deeply(\@events, $want, 'we got the events we expected');
|