1#!/usr/bin/perl -w # -*- perl -*- 2 3BEGIN { 4 require "./t/pod2html-lib.pl"; 5} 6 7END { 8 rem_test_dir(); 9} 10 11use strict; 12use Cwd; 13use File::Spec::Functions; 14use Test::More tests => 2; 15 16SKIP: { 17 my $output = make_test_dir(); 18 skip "$output", 2 if $output; 19 20 my $cwd = cwd(); 21 my ($v, $d) = splitpath($cwd, 1); 22 my @dirs = splitdir($d); 23 shift @dirs if $dirs[0] eq ''; 24 my $relcwd = join '/', @dirs; 25 26 my $data_pos = tell DATA; # to read <DATA> twice 27 28 convert_n_test("htmldir3", "test --htmldir and --htmlroot 3a", 29 "--podpath=$relcwd", 30 "--podroot=". catpath($v, '/', ''), 31 "--htmldir=". catdir($cwd, 't', ''), # test removal trailing slash, 32 "--quiet", 33 ); 34 35 seek DATA, $data_pos, 0; # to read <DATA> twice (expected output is the same) 36 37 convert_n_test("htmldir3", "test --htmldir and --htmlroot 3b", 38 "--podpath=". catdir($relcwd, 't'), 39 "--podroot=". catpath($v, '/', ''), 40 "--htmldir=t", 41 "--outfile=t/htmldir3.html", 42 "--quiet", 43 ); 44} 45 46__DATA__ 47<?xml version="1.0" ?> 48<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 49<html xmlns="http://www.w3.org/1999/xhtml"> 50<head> 51<title>htmldir - Test --htmldir feature</title> 52<meta http-equiv="content-type" content="text/html; charset=utf-8" /> 53<link rev="made" href="mailto:[PERLADMIN]" /> 54</head> 55 56<body> 57 58 59 60<ul id="index"> 61 <li><a href="#NAME">NAME</a></li> 62 <li><a href="#LINKS">LINKS</a></li> 63</ul> 64 65<h1 id="NAME">NAME</h1> 66 67<p>htmldir - Test --htmldir feature</p> 68 69<h1 id="LINKS">LINKS</h1> 70 71<p>Normal text, a <a>link</a> to nowhere,</p> 72 73<p>a link to <a href="[RELCURRENTWORKINGDIRECTORY]/testdir/test.lib/var-copy.html">var-copy</a>,</p> 74 75<p><a href="[RELCURRENTWORKINGDIRECTORY]/t/htmlescp.html">htmlescp</a>,</p> 76 77<p><a href="[RELCURRENTWORKINGDIRECTORY]/t/feature.html#Another-Head-1">"Another Head 1" in feature</a>,</p> 78 79<p>and another <a href="[RELCURRENTWORKINGDIRECTORY]/t/feature.html#Another-Head-1">"Another Head 1" in feature</a>.</p> 80 81 82</body> 83 84</html> 85 86 87