xref: /openbsd/gnu/usr.bin/perl/ext/Pod-Html/t/htmlview.t (revision eac174f2)
1898184e3SsthenBEGIN {
2*eac174f2Safresh1    use File::Spec::Functions ':ALL';
3*eac174f2Safresh1    @INC = map { rel2abs($_) }
4*eac174f2Safresh1             (qw| ./lib ./t/lib ../../lib |);
5898184e3Ssthen}
6898184e3Ssthen
7898184e3Ssthenuse strict;
8*eac174f2Safresh1use warnings;
9*eac174f2Safresh1use Test::More;
10*eac174f2Safresh1use Testing qw( setup_testing_dir xconvert );
11*eac174f2Safresh1use Cwd;
12898184e3Ssthen
13*eac174f2Safresh1my $debug = 0;
14*eac174f2Safresh1my $startdir = cwd();
15*eac174f2Safresh1END { chdir($startdir) or die("Cannot change back to $startdir: $!"); }
16*eac174f2Safresh1my ($expect_raw, $args);
17*eac174f2Safresh1{ local $/; $expect_raw = <DATA>; }
18*eac174f2Safresh1
19*eac174f2Safresh1my $tdir = setup_testing_dir( {
20*eac174f2Safresh1    debug       => $debug,
21*eac174f2Safresh1} );
22*eac174f2Safresh1
23*eac174f2Safresh1$args = {
24*eac174f2Safresh1    podstub => "htmlview",
25*eac174f2Safresh1    description => "html rendering",
26*eac174f2Safresh1    expect => $expect_raw,
27*eac174f2Safresh1    p2h => {
28*eac174f2Safresh1        podpath => 't',
29*eac174f2Safresh1        quiet  => 1,
30*eac174f2Safresh1    },
31*eac174f2Safresh1};
32*eac174f2Safresh1
33*eac174f2Safresh1xconvert($args);
34*eac174f2Safresh1
35*eac174f2Safresh1done_testing;
36898184e3Ssthen
37898184e3Ssthen__DATA__
38898184e3Ssthen<?xml version="1.0" ?>
39898184e3Ssthen<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
40898184e3Ssthen<html xmlns="http://www.w3.org/1999/xhtml">
41898184e3Ssthen<head>
429f11ffb7Safresh1<title>Test HTML Rendering</title>
43898184e3Ssthen<meta http-equiv="content-type" content="text/html; charset=utf-8" />
44898184e3Ssthen<link rev="made" href="mailto:[PERLADMIN]" />
45898184e3Ssthen</head>
46898184e3Ssthen
476fb12b70Safresh1<body>
48898184e3Ssthen
49898184e3Ssthen
50898184e3Ssthen
51898184e3Ssthen<ul id="index">
52898184e3Ssthen  <li><a href="#NAME">NAME</a></li>
53898184e3Ssthen  <li><a href="#SYNOPSIS">SYNOPSIS</a></li>
54898184e3Ssthen  <li><a href="#DESCRIPTION">DESCRIPTION</a></li>
55898184e3Ssthen  <li><a href="#METHODS-OTHER-STUFF">METHODS =&gt; OTHER STUFF</a>
56898184e3Ssthen    <ul>
5791f110e0Safresh1      <li><a href="#new">new()</a></li>
5891f110e0Safresh1      <li><a href="#old">old()</a></li>
59898184e3Ssthen    </ul>
60898184e3Ssthen  </li>
61898184e3Ssthen  <li><a href="#TESTING-FOR-AND-BEGIN">TESTING FOR AND BEGIN</a></li>
62898184e3Ssthen  <li><a href="#TESTING-URLs-hyperlinking">TESTING URLs hyperlinking</a></li>
63898184e3Ssthen  <li><a href="#SEE-ALSO">SEE ALSO</a></li>
64898184e3Ssthen  <li><a href="#POD-ERRORS">POD ERRORS</a></li>
65898184e3Ssthen</ul>
66898184e3Ssthen
67898184e3Ssthen<h1 id="NAME">NAME</h1>
68898184e3Ssthen
69898184e3Ssthen<p>Test HTML Rendering</p>
70898184e3Ssthen
71898184e3Ssthen<h1 id="SYNOPSIS">SYNOPSIS</h1>
72898184e3Ssthen
73898184e3Ssthen<pre><code>use My::Module;
74898184e3Ssthen
75898184e3Ssthenmy $module = My::Module-&gt;new();</code></pre>
76898184e3Ssthen
77898184e3Ssthen<h1 id="DESCRIPTION">DESCRIPTION</h1>
78898184e3Ssthen
79898184e3Ssthen<p>This is the description.</p>
80898184e3Ssthen
81898184e3Ssthen<pre><code>Here is a verbatim section.</code></pre>
82898184e3Ssthen
83898184e3Ssthen<p>This is some more regular text.</p>
84898184e3Ssthen
85898184e3Ssthen<p>Here is some <b>bold</b> text, some <i>italic</i> and something that looks like an &lt;html&gt; tag. This is some <code>$code($arg1)</code>.</p>
86898184e3Ssthen
87898184e3Ssthen<p>This <code>text contains embedded <b>bold</b> and <i>italic</i> tags</code>. These can be nested, allowing <b>bold and <i>bold &amp; italic</i> text</b>. The module also supports the extended <b>syntax</b> and permits <i>nested tags &amp; other <b>cool</b> stuff</i></p>
88898184e3Ssthen
89898184e3Ssthen<h1 id="METHODS-OTHER-STUFF">METHODS =&gt; OTHER STUFF</h1>
90898184e3Ssthen
91898184e3Ssthen<p>Here is a list of methods</p>
92898184e3Ssthen
9391f110e0Safresh1<h2 id="new">new()</h2>
94898184e3Ssthen
95898184e3Ssthen<p>Constructor method. Accepts the following config options:</p>
96898184e3Ssthen
97898184e3Ssthen<dl>
98898184e3Ssthen
99898184e3Ssthen<dt id="foo">foo</dt>
100898184e3Ssthen<dd>
101898184e3Ssthen
102898184e3Ssthen<p>The foo item.</p>
103898184e3Ssthen
104898184e3Ssthen</dd>
105898184e3Ssthen<dt id="bar">bar</dt>
106898184e3Ssthen<dd>
107898184e3Ssthen
108898184e3Ssthen<p>The bar item.</p>
109898184e3Ssthen
110898184e3Ssthen<ul>
111898184e3Ssthen
112898184e3Ssthen<p>This is a list within a list</p>
113898184e3Ssthen
114898184e3Ssthen<p>*</p>
115898184e3Ssthen
116898184e3Ssthen<p>The wiz item.</p>
117898184e3Ssthen
118898184e3Ssthen<p>*</p>
119898184e3Ssthen
120898184e3Ssthen<p>The waz item.</p>
121898184e3Ssthen
122898184e3Ssthen</ul>
123898184e3Ssthen
124898184e3Ssthen</dd>
125898184e3Ssthen<dt id="baz">baz</dt>
126898184e3Ssthen<dd>
127898184e3Ssthen
128898184e3Ssthen<p>The baz item.</p>
129898184e3Ssthen
130898184e3Ssthen<ul>
131898184e3Ssthen
132898184e3Ssthen<li><p>A correct list within a list</p>
133898184e3Ssthen
134898184e3Ssthen</li>
135898184e3Ssthen<li><p>Boomerang</p>
136898184e3Ssthen
137898184e3Ssthen</li>
138898184e3Ssthen</ul>
139898184e3Ssthen
140898184e3Ssthen</dd>
141898184e3Ssthen</dl>
142898184e3Ssthen
143898184e3Ssthen<p>Title on the same line as the =item + * bullets</p>
144898184e3Ssthen
145898184e3Ssthen<ul>
146898184e3Ssthen
147898184e3Ssthen<li><p><code>Black</code> Cat</p>
148898184e3Ssthen
149898184e3Ssthen</li>
150898184e3Ssthen<li><p>Sat <span style="white-space: nowrap;"><i>on</i> the</span></p>
151898184e3Ssthen
152898184e3Ssthen</li>
153898184e3Ssthen<li><p>Mat&lt;!&gt;</p>
154898184e3Ssthen
155898184e3Ssthen</li>
156898184e3Ssthen</ul>
157898184e3Ssthen
158898184e3Ssthen<p>Title on the same line as the =item + numerical bullets</p>
159898184e3Ssthen
160898184e3Ssthen<ol>
161898184e3Ssthen
162898184e3Ssthen<li><p>Cat</p>
163898184e3Ssthen
164898184e3Ssthen</li>
165898184e3Ssthen<li><p>Sat</p>
166898184e3Ssthen
167898184e3Ssthen</li>
168898184e3Ssthen<li><p>Mat</p>
169898184e3Ssthen
170898184e3Ssthen</li>
171898184e3Ssthen</ol>
172898184e3Ssthen
173898184e3Ssthen<p>Numbered list with text on the same line</p>
174898184e3Ssthen
175898184e3Ssthen<dl>
176898184e3Ssthen
177898184e3Ssthen<dt id="Cat">1 Cat</dt>
178898184e3Ssthen<dd>
179898184e3Ssthen
180898184e3Ssthen</dd>
181898184e3Ssthen<dt id="Sat">2 Sat</dt>
182898184e3Ssthen<dd>
183898184e3Ssthen
184898184e3Ssthen</dd>
185898184e3Ssthen<dt id="Mat">3 Mat</dt>
186898184e3Ssthen<dd>
187898184e3Ssthen
188898184e3Ssthen</dd>
189898184e3Ssthen</dl>
190898184e3Ssthen
191898184e3Ssthen<p>No bullets, no title</p>
192898184e3Ssthen
193898184e3Ssthen<ul>
194898184e3Ssthen
195898184e3Ssthen<li><p>Cat</p>
196898184e3Ssthen
197898184e3Ssthen</li>
198898184e3Ssthen<li><p>Sat</p>
199898184e3Ssthen
200898184e3Ssthen</li>
201898184e3Ssthen<li><p>Mat</p>
202898184e3Ssthen
203898184e3Ssthen</li>
204898184e3Ssthen</ul>
205898184e3Ssthen
20691f110e0Safresh1<h2 id="old">old()</h2>
207898184e3Ssthen
208898184e3Ssthen<p>Destructor method</p>
209898184e3Ssthen
210898184e3Ssthen<h1 id="TESTING-FOR-AND-BEGIN">TESTING FOR AND BEGIN</h1>
211898184e3Ssthen
212898184e3Ssthen
213898184e3Ssthen
214898184e3Ssthen<br />
215898184e3Ssthen<p>
216898184e3Ssthenblah blah
217898184e3Ssthen</p>
218898184e3Ssthen
219898184e3Ssthen<p>intermediate text</p>
220898184e3Ssthen
221898184e3Ssthen<more>
222898184e3SsthenHTML
223b8851fccSafresh1</more>
224b8851fccSafresh1
225b8851fccSafresh1some text
226898184e3Ssthen
227898184e3Ssthen<h1 id="TESTING-URLs-hyperlinking">TESTING URLs hyperlinking</h1>
228898184e3Ssthen
229898184e3Ssthen<p>This is an href link1: http://example.com</p>
230898184e3Ssthen
231898184e3Ssthen<p>This is an href link2: http://example.com/foo/bar.html</p>
232898184e3Ssthen
233898184e3Ssthen<p>This is an email link: mailto:foo@bar.com</p>
234898184e3Ssthen
235898184e3Ssthen<pre><code>This is a link in a verbatim block &lt;a href=&quot;http://perl.org&quot;&gt; Perl &lt;/a&gt;</code></pre>
236898184e3Ssthen
237898184e3Ssthen<h1 id="SEE-ALSO">SEE ALSO</h1>
238898184e3Ssthen
239898184e3Ssthen<p>See also <a href="/t/htmlescp.html">Test Page 2</a>, the <a>Your::Module</a> and <a>Their::Module</a> manpages and the other interesting file <i>/usr/local/my/module/rocks</i> as well.</p>
240898184e3Ssthen
241898184e3Ssthen<h1 id="POD-ERRORS">POD ERRORS</h1>
242898184e3Ssthen
243898184e3Ssthen<p>Hey! <b>The above document had some coding errors, which are explained below:</b></p>
244898184e3Ssthen
245898184e3Ssthen<dl>
246898184e3Ssthen
24791f110e0Safresh1<dt id="Around-line-45">Around line 45:</dt>
248898184e3Ssthen<dd>
249898184e3Ssthen
250898184e3Ssthen<p>You can&#39;t have =items (as at line 49) unless the first thing after the =over is an =item</p>
251898184e3Ssthen
252898184e3Ssthen</dd>
253898184e3Ssthen</dl>
254898184e3Ssthen
255898184e3Ssthen
256898184e3Ssthen</body>
257898184e3Ssthen
258898184e3Ssthen</html>
259898184e3Ssthen
260898184e3Ssthen
261