summaryrefslogtreecommitdiff
path: root/ext/Pod-Html/t/htmldir.t
diff options
context:
space:
mode:
Diffstat (limited to 'ext/Pod-Html/t/htmldir.t')
-rw-r--r--ext/Pod-Html/t/htmldir.t27
1 files changed, 15 insertions, 12 deletions
diff --git a/ext/Pod-Html/t/htmldir.t b/ext/Pod-Html/t/htmldir.t
index e11f31817c..2a0fc7c8c4 100644
--- a/ext/Pod-Html/t/htmldir.t
+++ b/ext/Pod-Html/t/htmldir.t
@@ -6,20 +6,21 @@ BEGIN {
use strict;
use Test::More tests => 2;
+use File::Spec::Functions;
use File::Spec;
use Cwd;
-# XXX Is there a better way to do this? I need a relative url to cwd because of
-# --podpath and --podroot
-# Remove root dir from path
-my $relcwd = substr(Cwd::cwd(), length(File::Spec->rootdir()));
+my ($v, $d) = splitpath(cwd(), 1);
+my $relcwd = substr($d, length(File::Spec->rootdir()));
my $data_pos = tell DATA; # to read <DATA> twice
+my $podpath = catdir($relcwd, 't') . ":" . catfile($relcwd, 'test.lib');
+
convert_n_test("htmldir", "test --htmldir and --htmlroot 1a",
- "--podpath=$relcwd/t:$relcwd/test.lib",
- "--podroot=/",
+ "--podpath=$podpath",
+ "--podroot=$v".File::Spec->rootdir,
# "--podpath=t",
# "--htmlroot=/test/dir",
"--htmldir=t",
@@ -27,10 +28,12 @@ convert_n_test("htmldir", "test --htmldir and --htmlroot 1a",
seek DATA, $data_pos, 0; # to read <DATA> twice (expected output is the same)
+my $htmldir = catfile $relcwd, 't';
+
convert_n_test("htmldir", "test --htmldir and --htmlroot 1b",
"--podpath=$relcwd",
- "--podroot=/",
- "--htmldir=$relcwd/t",
+ "--podroot=$v".File::Spec->rootdir,
+ "--htmldir=$htmldir",
"--htmlroot=/",
);
@@ -61,13 +64,13 @@ __DATA__
<p>Normal text, a <a>link</a> to nowhere,</p>
-<p>a link to <a href="[CURRENTWORKINGDIRECTORY]/test.lib/perlvar.html">perlvar</a>,</p>
+<p>a link to <a href="/[RELCURRENTWORKINGDIRECTORY]/test.lib/perlvar.html">perlvar</a>,</p>
-<p><a href="[CURRENTWORKINGDIRECTORY]/t/htmlescp.html">htmlescp</a>,</p>
+<p><a href="/[RELCURRENTWORKINGDIRECTORY]/t/htmlescp.html">htmlescp</a>,</p>
-<p><a href="[CURRENTWORKINGDIRECTORY]/t/htmlfeature.html#Another-Head-1">&quot;Another Head 1&quot; in htmlfeature</a>,</p>
+<p><a href="/[RELCURRENTWORKINGDIRECTORY]/t/htmlfeature.html#Another-Head-1">&quot;Another Head 1&quot; in htmlfeature</a>,</p>
-<p>and another <a href="[CURRENTWORKINGDIRECTORY]/t/htmlfeature.html#Another-Head-1">&quot;Another Head 1&quot; in htmlfeature</a>.</p>
+<p>and another <a href="/[RELCURRENTWORKINGDIRECTORY]/t/htmlfeature.html#Another-Head-1">&quot;Another Head 1&quot; in htmlfeature</a>.</p>
</body>