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