1BEGIN {
2    use File::Spec::Functions ':ALL';
3    @INC = map { rel2abs($_) }
4             (qw| ./lib ./t/lib ../../lib |);
5}
6
7use strict;
8use warnings;
9use Test::More;
10use Testing qw( setup_testing_dir xconvert );
11use Cwd;
12use Pod::Html::Util qw(
13    unixify
14);
15
16my $debug = 0;
17my $startdir = cwd();
18END { chdir($startdir) or die("Cannot change back to $startdir: $!"); }
19my ($expect_raw, $args);
20{ local $/; $expect_raw = <DATA>; }
21
22my $tdir = setup_testing_dir( {
23    debug       => $debug,
24} );
25
26my $cwd = unixify(cwd());
27
28$args = {
29    podstub => "crossref",
30    description => "cross references",
31    expect => $expect_raw,
32    p2h => {
33        podpath    => 't:corpus/test.lib',
34        podroot    => $cwd,
35        htmldir    => $cwd,
36        quiet      => 1,
37    },
38    debug => $debug,
39};
40xconvert($args);
41
42done_testing;
43
44__DATA__
45<?xml version="1.0" ?>
46<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
47<html xmlns="http://www.w3.org/1999/xhtml">
48<head>
49<title>htmlcrossref - Test HTML cross reference links</title>
50<meta http-equiv="content-type" content="text/html; charset=utf-8" />
51<link rev="made" href="mailto:[PERLADMIN]" />
52</head>
53
54<body>
55
56
57
58<ul id="index">
59  <li><a href="#NAME">NAME</a></li>
60  <li><a href="#LINKS">LINKS</a></li>
61  <li><a href="#TARGETS">TARGETS</a>
62    <ul>
63      <li><a href="#section1">section1</a></li>
64    </ul>
65  </li>
66</ul>
67
68<h1 id="NAME">NAME</h1>
69
70<p>htmlcrossref - Test HTML cross reference links</p>
71
72<h1 id="LINKS">LINKS</h1>
73
74<p><a href="#section1">&quot;section1&quot;</a></p>
75
76<p><a href="./htmllink.html#section-2">&quot;section 2&quot; in htmllink</a></p>
77
78<p><a href="#item1">&quot;item1&quot;</a></p>
79
80<p><a href="#non-existent-section">&quot;non existent section&quot;</a></p>
81
82<p><a href="../corpus/test.lib/var-copy.html">var-copy</a></p>
83
84<p><a href="../corpus/test.lib/var-copy.html#pod">&quot;$&quot;&quot; in var-copy</a></p>
85
86<p><code>var-copy</code></p>
87
88<p><code>var-copy/$&quot;</code></p>
89
90<p><a href="../corpus/test.lib/podspec-copy.html#First">&quot;First:&quot; in podspec-copy</a></p>
91
92<p><code>podspec-copy/First:</code></p>
93
94<p><a>notperldoc</a></p>
95
96<h1 id="TARGETS">TARGETS</h1>
97
98<h2 id="section1">section1</h2>
99
100<p>This is section one.</p>
101
102<dl>
103
104<dt id="item1">item1  </dt>
105<dd>
106
107<p>This is item one.</p>
108
109</dd>
110</dl>
111
112
113</body>
114
115</html>
116
117
118