File: 14target.t

package info (click to toggle)
libpod-sax-perl 0.14-7
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 172 kB
  • sloc: perl: 545; makefile: 7
file content (62 lines) | stat: -rw-r--r-- 1,197 bytes parent folder | download | duplicates (4)
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
use Test;
BEGIN { plan tests => 6 }
use Pod::SAX;
use XML::SAX::Writer;

my $output = '';
my $p = Pod::SAX->new(
            Handler => XML::SAX::Writer->new(
                Output => \$output
                )
            );

ok($p);
$p->parse_file(\*DATA);
ok($output);
print "$output\n";
ok($output, qr/<pod>.*<\/pod>/s, "Matches basic pod outline");
ok($output, qr/<link/, "Contains a link");
ok($output, qr/<xlink\s+href=['"]http:\/\/axkit.org\/['"]/, "URL link");
ok($output, qr/<xlink\s+href=['"]http:\/\/axkit.org\/['"]>with text/, "URL link");

__DATA__

=head1 NAME

SomePod - Some Pod to parse

=head1 DESCRIPTION

Foo here's a L<page1>

Here's a L<page2/mysection>

Here's a L<Some Text|page3/mysection>

And a URL L<http://axkit.org/>

A URL L<with text|http://axkit.org/>

A link with text L<Some Text|Link>

=head2 Sub Title

More

=over

=item Link in =item: L<link>

=item Link with text in =item: L<Some text|LinkHere>

=back

A really complex link example from TorgoX:

L<< SWITCH B<<< E<115>tatements >>>|perlsyn/Basic I<<<< BLOCKs >>>> and Switch StatementE<115> >>

And another from the axkit wiki:

  Can I L<< Trying a link with a F<file/reference> >> link to that?

=cut