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