#!/usr/bin/perl -w # -*- perl -*- use strict; use lib qw( ./lib ../lib ); use Pod::POM; use Pod::POM::View::HTML; use Pod::POM::Test; ntests(2); $Pod::POM::DEFAULT_VIEW = 'Pod::POM::View::HTML'; my $text; { local $/ = undef; $text = ; } my ($test, $expect) = split(/\s*-------+\s*/, $text); my $parser = Pod::POM->new(); my $pom = $parser->parse_text($test); assert( $pom ); my $result = "$pom"; for ($result, $expect) { s/^\s*//; s/\s*$//; } #match($result, $expect); use constant HAS_TEXT_DIFF => eval { require Text::Diff}; if (HAS_TEXT_DIFF) { diff($expect, $result, 2); } else { match($result, $expect); } sub diff { my($expect, $result, $tnum) = @_; my $diff = Text::Diff::diff(\$expect, \$result, {STYLE=> "Unified"}); if ($diff) { print "not ok $tnum\n"; print $diff; } else { print "ok $tnum\n"; } } #print $pom; __DATA__ =head1 NAME Test =head1 SYNOPSIS use My::Module; my $module = My::Module->new(); =head1 DESCRIPTION This is the description. Here is a verbatim section. This is some more regular text. Here is some B text, some I and something that looks like an EhtmlE tag. This is some C<$code($arg1)>. This C and I tags>. These can be nested, allowing B italic> text>. The module also supports the extended B<< syntax >> and permits I<< nested tags E other B<<< cool >>> stuff >> =head1 METHODS =E OTHER STUFF Here is a list of methods =head2 new() Constructor method. Accepts the following config options: =over 4 =item foo The foo item. =item bar The bar item. =over 4 This is a list within a list =item * The wiz item. =item * The waz item. =back =item baz The baz item. =back Title on the same line as the =item + * bullets =over =item * C Cat =item * Sat S the> =item * MatE!E =back Title on the same line as the =item + numerical bullets =over =item 1 Cat =item 2 Sat =item 3 Mat =back No bullets, no title =over =item Cat =item Sat =item Mat =back =head2 old() Destructor method =head1 TESTING FOR AND BEGIN =for html

blah blah

intermediate text =begin html HTML some text =end =head1 TESTING URLs hyperlinking This is an href link1: http://example.com This is an href link2: http://example.com/foo/bar.html This is an email link: mailto:foo@bar.com =head1 SEE ALSO See also L, the L and L manpages and the other interesting file F as well. =cut ------------------------------------------------------------------------

NAME

Test

SYNOPSIS

    use My::Module;

    my $module = My::Module->new();

DESCRIPTION

This is the description.

    Here is a verbatim section.

This is some more regular text.

Here is some bold text, some italic and something that looks like an <html> tag. This is some $code($arg1).

This text contains embedded bold and italic tags. These can be nested, allowing bold and bold & italic text. The module also supports the extended syntax and permits nested tags & other cool stuff

METHODS => OTHER STUFF

Here is a list of methods

new()

Constructor method. Accepts the following config options:

  • foo

    The foo item.

  • bar

    The bar item.

      This is a list within a list

    • The wiz item.

    • The waz item.

  • baz

    The baz item.

Title on the same line as the =item + * bullets

  • Black Cat
  • Sat on the
  • Mat<!>

Title on the same line as the =item + numerical bullets

  1. Cat
  2. Sat
  3. Mat

No bullets, no title

  • Cat

  • Sat

  • Mat

old()

Destructor method

TESTING FOR AND BEGIN


blah blah

intermediate text

HTML some text

TESTING URLs hyperlinking

This is an href link1: http://example.com

This is an href link2: http://example.com/foo/bar.html

This is an email link: mailto:foo@bar.com

SEE ALSO

See also Test Page 2, the Your::Module and Their::Module manpages and the other interesting file /usr/local/my/module/rocks as well.