htmldir1.t revision 1.1.1.3
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
16# XXX Separate tests that rely on test.lib from the others so they are the only
17# ones skipped (instead of all of them). This applies to htmldir{1,3,5}.t, and 
18# crossref.t (as of 10/29/11). 
19SKIP: {
20    my $output = make_test_dir();
21    skip "$output", 2 if $output;
22
23    my ($v, $d) = splitpath(cwd(), 1);
24    my @dirs = splitdir($d);
25    shift @dirs if $dirs[0] eq '';
26    my $relcwd = join '/', @dirs;
27
28    my $data_pos = tell DATA; # to read <DATA> twice
29
30
31    convert_n_test("htmldir1", "test --htmldir and --htmlroot 1a", 
32     "--podpath=". File::Spec::Unix->catdir($relcwd, 't') . ":"
33                 . File::Spec::Unix->catdir($relcwd, 'testdir/test.lib'),
34     "--podroot=". catpath($v, '/', ''),
35     "--htmldir=t",
36     "--quiet",
37    );
38
39    seek DATA, $data_pos, 0; # to read <DATA> twice (expected output is the same)
40
41    convert_n_test("htmldir1", "test --htmldir and --htmlroot 1b", 
42     "--podpath=$relcwd",
43     "--podroot=". catpath($v, '/', ''),
44     "--htmldir=". catdir($relcwd, 't'),
45     "--htmlroot=/",
46     "--quiet",
47    );
48}
49
50__DATA__
51<?xml version="1.0" ?>
52<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
53<html xmlns="http://www.w3.org/1999/xhtml">
54<head>
55<title></title>
56<meta http-equiv="content-type" content="text/html; charset=utf-8" />
57<link rev="made" href="mailto:[PERLADMIN]" />
58</head>
59
60<body>
61
62
63
64<ul id="index">
65  <li><a href="#NAME">NAME</a></li>
66  <li><a href="#LINKS">LINKS</a></li>
67</ul>
68
69<h1 id="NAME">NAME</h1>
70
71<p>htmldir - Test --htmldir feature</p>
72
73<h1 id="LINKS">LINKS</h1>
74
75<pre><code>  Verbatim B&lt;means&gt; verbatim.</code></pre>
76
77<p>Normal text, a <a>link</a> to nowhere,</p>
78
79<p>a link to <a href="/[RELCURRENTWORKINGDIRECTORY]/testdir/test.lib/var-copy.html">var-copy</a>,</p>
80
81<p><a href="/[RELCURRENTWORKINGDIRECTORY]/t/htmlescp.html">htmlescp</a>,</p>
82
83<p><a href="/[RELCURRENTWORKINGDIRECTORY]/t/feature.html#Another-Head-1">&quot;Another Head 1&quot; in feature</a>,</p>
84
85<p>and another <a href="/[RELCURRENTWORKINGDIRECTORY]/t/feature.html#Another-Head-1">&quot;Another Head 1&quot; in feature</a>.</p>
86
87
88</body>
89
90</html>
91
92
93