htmldir1.t revision 1.1.1.5
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 => "htmldir1", 30 description => "test --htmldir and --htmlroot 1a", 31 expect => $expect_raw, 32 p2h => { 33 podpath => File::Spec::Unix->catdir($relcwd, 't') . ":" . 34 File::Spec::Unix->catdir($relcwd, 'corpus/test.lib'), 35 podroot => catpath($v, '/', ''), 36 htmldir => 't', 37 quiet => 1, 38 }, 39 debug => $debug, 40}; 41xconvert($args); 42 43$args = { 44 podstub => "htmldir1", 45 description => "test --htmldir and --htmlroot 1b", 46 expect => $expect_raw, 47 p2h => { 48 podpath => $relcwd, 49 podroot => catpath($v, '/', ''), 50 htmldir => catdir($relcwd, 't'), 51 htmlroot => '/', 52 quiet => 1, 53 }, 54 debug => $debug, 55}; 56xconvert($args); 57 58done_testing; 59 60__DATA__ 61<?xml version="1.0" ?> 62<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 63<html xmlns="http://www.w3.org/1999/xhtml"> 64<head> 65<title>htmldir - Test --htmldir feature</title> 66<meta http-equiv="content-type" content="text/html; charset=utf-8" /> 67<link rev="made" href="mailto:[PERLADMIN]" /> 68</head> 69 70<body> 71 72 73 74<ul id="index"> 75 <li><a href="#NAME">NAME</a></li> 76 <li><a href="#LINKS">LINKS</a></li> 77</ul> 78 79<h1 id="NAME">NAME</h1> 80 81<p>htmldir - Test --htmldir feature</p> 82 83<h1 id="LINKS">LINKS</h1> 84 85<pre><code>Verbatim B<means> verbatim.</code></pre> 86 87<p>Normal text, a <a>link</a> to nowhere,</p> 88 89<p>a link to <a href="/[RELCURRENTWORKINGDIRECTORY]/corpus/test.lib/var-copy.html">var-copy</a>,</p> 90 91<p><a href="/[RELCURRENTWORKINGDIRECTORY]/t/htmlescp.html">htmlescp</a>,</p> 92 93<p><a href="/[RELCURRENTWORKINGDIRECTORY]/t/feature.html#Another-Head-1">"Another Head 1" in feature</a>,</p> 94 95<p>and another <a href="/[RELCURRENTWORKINGDIRECTORY]/t/feature.html#Another-Head-1">"Another Head 1" in feature</a>.</p> 96 97 98</body> 99 100</html> 101 102 103