File: non-pod.t

package info (click to toggle)
libpod-eventual-perl 0.094001-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, stretch
  • size: 176 kB
  • ctags: 14
  • sloc: perl: 172; makefile: 7
file content (39 lines) | stat: -rw-r--r-- 1,028 bytes parent folder | download | duplicates (5)
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
use strict;
use warnings;

use Test::More tests => 1;
use Test::Deep;
use Pod::Eventual::Simple;

my $output = Pod::Eventual::Simple->read_file('eg/non-pod.pl');
my @events = @$output;

my $want = [
  {
    type       => 'nonpod',
    content    => re(qr{\A#!perl.+tion';\n\n\z}s),
    start_line => 1
  },
  { type => 'command', content => "\n", start_line =>  8, command => 'head1' },
  { type => 'blank',   content => "\n", start_line =>  9 },
  {
    type       => 'text',
    content    => re(qr{\AWe're.+stuff\.\n}s),
    start_line => 10,
  },
  { type => 'blank',   content => "\n", start_line => 11 },
  {
    type       => 'text',
    content    => re(qr{\AIt.+awesome\.\n}s),
    start_line => 12,
  },
  { type => 'blank',   content => "\n", start_line => 13 },
  { type => 'command', content => "\n", start_line => 14, command => 'cut' },
  {
    type       => 'nonpod',
    content    => "\n# ...and now we're done!\n\n",
    start_line => 15
  },
];

cmp_deeply(\@events, $want, 'we got the events we expected');