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 $cwd = catdir cwd(); # catdir converts path separators to that of the OS
24                        # running the test
25                        # XXX but why don't the other tests complain about
26                        # this?
27
28$args = {
29    podstub => "htmldir5",
30    description => "test --htmldir and --htmlroot 5",
31    expect => $expect_raw,
32    p2h => {
33        podpath     => 't:corpus/test.lib',
34        podroot     => $cwd,
35        htmldir     => $cwd,
36        htmlroot    => '/',
37        quiet       => 1,
38    },
39    debug => $debug,
40};
41xconvert($args);
42
43done_testing;
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>htmldir - Test --htmldir feature</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>
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="../corpus/test.lib/var-copy.html">var-copy</a>,</p>
73
74<p><a href="./htmlescp.html">htmlescp</a>,</p>
75
76<p><a href="./feature.html#Another-Head-1">&quot;Another Head 1&quot; in feature</a>,</p>
77
78<p>and another <a href="./feature.html#Another-Head-1">&quot;Another Head 1&quot; in feature</a>.</p>
79
80
81</body>
82
83</html>
84
85
86