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