File: PodChecker.pm

package info (click to toggle)
libcode-tidyall-perl 0.78~ds-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,048 kB
  • sloc: perl: 5,061; lisp: 47; sh: 4; makefile: 2
file content (43 lines) | stat: -rw-r--r-- 1,439 bytes parent folder | download | duplicates (2)
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
package TestFor::Code::TidyAll::Plugin::PodChecker;

use Test::Class::Most parent => 'TestFor::Code::TidyAll::Plugin';

sub test_main : Tests {
    my $self = shift;

    $self->tidyall(
        source    => '=head1 DESCRIPTION\n\nHello',
        expect_ok => 1,
        desc      => 'ok',
    );
    $self->tidyall(
        source       => '=head1 METHODS\n\n=over\n\n=item * foo\n\n',
        expect_error => qr/without closing =back/,
        desc         => 'error',
    );
    $self->tidyall(
        source    => '=head1 DESCRIPTION\n\n=head1 METHODS\n\n',
        expect_ok => 1,
        desc      => 'ok - empty section, no warnings',
    );
    $self->tidyall(
        source       => '=head1 DESCRIPTION\n\n=head1 METHODS\n\n',
        conf         => { warnings => 1 },
        expect_error => qr/empty section in previous paragraph/,
        desc         => 'error - empty section, warnings=1',
    );
    $self->tidyall(
        source    => '=head1 DESCRIPTION\n\nblah blah\n\n=head1 DESCRIPTION\n\nblah blah',
        conf      => { warnings => 1 },
        expect_ok => 1,
        desc      => 'ok - duplicate section, warnings=1',
    );
    $self->tidyall(
        source       => '=head1 DESCRIPTION\n\nblah blah\n\n=head1 DESCRIPTION\n\nblah blah',
        conf         => { warnings => 2 },
        expect_error => qr/multiple occurrence/,
        desc         => 'error - duplicate section, warnings=2',
    );
}

1;