From: Stas Bekman Date: Fri, 22 Mar 2002 01:28:03 +0000 (+0800) Subject: Re: [tests for Pod::Html] X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d8022526a1bef8ae4dc11ee77c7986f6f9a3bce4;p=p5sagit%2Fp5-mst-13.2.git Re: [tests for Pod::Html] Message-ID: p4raw-id: //depot/perl@15393 --- diff --git a/MANIFEST b/MANIFEST index 5a1e01a..0459088 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1301,6 +1301,8 @@ lib/Pod/t/basic.txt podlators test lib/Pod/t/Functions.t See if Pod::Functions works lib/Pod/t/htmlescp.pod pod2html escape test input data lib/Pod/t/htmlescp.t pod2html escape test +lib/Pod/t/htmlview.t pod2html render test +lib/Pod/t/htmlview.pod pod2html render test input data lib/Pod/t/InputObjects.t See if Pod::InputObjects works lib/Pod/t/latex.t See if Pod::LaTeX works lib/Pod/t/man.t podlators test @@ -2458,7 +2460,6 @@ t/pod/testcmp.pl Module to compare output against expected results t/pod/testp2pt.pl Module to test Pod::PlainText for a given file t/pod/testpchk.pl Module to test Pod::Checker for a given file t/pod/testpods/lib/Pod/Stuff.pm Sample data for find.t -t/pod2html/README Placeholder to keep the t/pod2html directory. t/README Instructions for regression tests t/run/exit.t Test perl's exit status. t/run/fresh_perl.t Tests that require a fresh perl. diff --git a/lib/Pod/t/htmlview.pod b/lib/Pod/t/htmlview.pod new file mode 100644 index 0000000..62ac71c --- /dev/null +++ b/lib/Pod/t/htmlview.pod @@ -0,0 +1,144 @@ +=head1 NAME + +Test HTML Rendering + +=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 html + +=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 diff --git a/lib/Pod/t/htmlview.t b/lib/Pod/t/htmlview.t new file mode 100644 index 0000000..a36b58a --- /dev/null +++ b/lib/Pod/t/htmlview.t @@ -0,0 +1,176 @@ +#!/usr/bin/perl -w # -*- perl -*- + +BEGIN { + chdir 't' if -d 't'; + unshift @INC, '../lib'; + unshift @INC, '../lib/Pod/t'; + require "pod2html-lib.pl"; +} + + +use strict; +use Test::More tests => 1; + +convert_n_test("htmlview", "html rendering"); + + +__DATA__ + + + +NAME + + + + + +

+ + + + + +
+

+

+

NAME

+

Test HTML Rendering

+

+

+
+

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

+ +

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

+
    +
  1. Cat
    +
  2. +
  3. Sat
    +
  4. +
  5. Mat
    +
  6. +
+

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 the Your::Module manpage and the Their::Module manpage +manpages and the other interesting file /usr/local/my/module/rocks +as well.

+ + + + diff --git a/lib/Pod/t/pod2html-lib.pl b/lib/Pod/t/pod2html-lib.pl index b44a3aa..de26389 100644 --- a/lib/Pod/t/pod2html-lib.pl +++ b/lib/Pod/t/pod2html-lib.pl @@ -7,13 +7,14 @@ sub convert_n_test { my($podfile, $testname) = @_; my $cwd = Cwd::cwd(); - my $new_dir = catdir $cwd, "..", "lib", "Pod", "t"; - my $infile = catfile $new_dir, "$podfile.pod"; - my $outfile = catfile $new_dir, "$podfile.html"; + my $base_dir = catdir $cwd, "..", "lib", "Pod"; + my $new_dir = catdir $base_dir, "t"; + my $infile = catfile $new_dir, "$podfile.pod"; + my $outfile = catfile $new_dir, "$podfile.html"; Pod::Html::pod2html( - "--podpath=pod2html", - "--podroot=$cwd", + "--podpath=t", + "--podroot=$base_dir", "--htmlroot=/", "--infile=$infile", "--outfile=$outfile" diff --git a/t/pod2html/README b/t/pod2html/README deleted file mode 100644 index 5cf548e..0000000 --- a/t/pod2html/README +++ /dev/null @@ -1 +0,0 @@ -This is a placeholder directory for the pod2html tests.