summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/Pod-Html/t/crossref.t10
-rw-r--r--ext/Pod-Html/t/crossref2.t2
-rw-r--r--ext/Pod-Html/t/crossref3.t2
-rw-r--r--ext/Pod-Html/t/htmldir1.t12
-rw-r--r--ext/Pod-Html/t/htmldir3.t9
-rw-r--r--ext/Pod-Html/t/pod2html-lib.pl6
6 files changed, 23 insertions, 18 deletions
diff --git a/ext/Pod-Html/t/crossref.t b/ext/Pod-Html/t/crossref.t
index ec178e0024..e3f9480da8 100644
--- a/ext/Pod-Html/t/crossref.t
+++ b/ext/Pod-Html/t/crossref.t
@@ -10,7 +10,6 @@ END {
use strict;
use Cwd;
-use File::Spec;
use File::Spec::Functions;
use Test::More tests => 1;
@@ -19,11 +18,14 @@ SKIP: {
skip "$output", 1 if $output;
my ($v, $d) = splitpath(cwd(), 1);
- my $relcwd = substr($d, length(File::Spec->rootdir()));
+ my @dirs = splitdir($d);
+ shift @dirs if $dirs[0] eq '';
+ my $relcwd = join '/', @dirs;
convert_n_test("crossref", "cross references",
- "--podpath=". catdir($relcwd, 't') . ":" . catdir($relcwd, 'testdir/test.lib'),
- "--podroot=$v". File::Spec->rootdir,
+ "--podpath=". File::Spec::Unix->catdir($relcwd, 't') . ":"
+ . File::Spec::Unix->catdir($relcwd, 'testdir/test.lib'),
+ "--podroot=". catpath($v, '/', ''),
"--quiet",
);
}
diff --git a/ext/Pod-Html/t/crossref2.t b/ext/Pod-Html/t/crossref2.t
index ce8fd6f804..4d8b03f6ca 100644
--- a/ext/Pod-Html/t/crossref2.t
+++ b/ext/Pod-Html/t/crossref2.t
@@ -10,8 +10,6 @@ END {
use strict;
use Cwd;
-use File::Spec;
-use File::Spec::Functions;
use Test::More tests => 1;
SKIP: {
diff --git a/ext/Pod-Html/t/crossref3.t b/ext/Pod-Html/t/crossref3.t
index 309d5ed888..c6c7b0ef3f 100644
--- a/ext/Pod-Html/t/crossref3.t
+++ b/ext/Pod-Html/t/crossref3.t
@@ -10,8 +10,6 @@ END {
use strict;
use Cwd;
-use File::Spec;
-use File::Spec::Functions;
use Test::More tests => 1;
SKIP: {
diff --git a/ext/Pod-Html/t/htmldir1.t b/ext/Pod-Html/t/htmldir1.t
index 881e3d6dce..8dd285473f 100644
--- a/ext/Pod-Html/t/htmldir1.t
+++ b/ext/Pod-Html/t/htmldir1.t
@@ -10,7 +10,6 @@ END {
use strict;
use Cwd;
-use File::Spec;
use File::Spec::Functions;
use Test::More tests => 2;
@@ -22,14 +21,17 @@ SKIP: {
skip "$output", 2 if $output;
my ($v, $d) = splitpath(cwd(), 1);
- my $relcwd = substr($d, length(File::Spec->rootdir()));
+ my @dirs = splitdir($d);
+ shift @dirs if $dirs[0] eq '';
+ my $relcwd = join '/', @dirs;
my $data_pos = tell DATA; # to read <DATA> twice
convert_n_test("htmldir1", "test --htmldir and --htmlroot 1a",
- "--podpath=". catdir($relcwd, 't') . ":" . catfile($relcwd, 'testdir/test.lib'),
- "--podroot=$v". File::Spec->rootdir,
+ "--podpath=". File::Spec::Unix->catdir($relcwd, 't') . ":"
+ . File::Spec::Unix->catdir($relcwd, 'testdir/test.lib'),
+ "--podroot=". catpath($v, '/', ''),
"--htmldir=t",
"--quiet",
);
@@ -38,7 +40,7 @@ SKIP: {
convert_n_test("htmldir1", "test --htmldir and --htmlroot 1b",
"--podpath=$relcwd",
- "--podroot=$v". File::Spec->rootdir,
+ "--podroot=". catpath($v, '/', ''),
"--htmldir=". catdir($relcwd, 't'),
"--htmlroot=/",
"--quiet",
diff --git a/ext/Pod-Html/t/htmldir3.t b/ext/Pod-Html/t/htmldir3.t
index 555dc74862..184b5c60be 100644
--- a/ext/Pod-Html/t/htmldir3.t
+++ b/ext/Pod-Html/t/htmldir3.t
@@ -10,7 +10,6 @@ END {
use strict;
use Cwd;
-use File::Spec;
use File::Spec::Functions;
use Test::More tests => 2;
@@ -20,13 +19,15 @@ SKIP: {
my $cwd = cwd();
my ($v, $d) = splitpath($cwd, 1);
- my $relcwd = substr($d, length(File::Spec->rootdir()));
+ my @dirs = splitdir($d);
+ shift @dirs if $dirs[0] eq '';
+ my $relcwd = join '/', @dirs;
my $data_pos = tell DATA; # to read <DATA> twice
convert_n_test("htmldir3", "test --htmldir and --htmlroot 3a",
"--podpath=$relcwd",
- "--podroot=$v". File::Spec->rootdir,
+ "--podroot=". catpath($v, '/', ''),
"--htmldir=". catdir($cwd, 't', ''), # test removal trailing slash,
"--quiet",
);
@@ -35,7 +36,7 @@ SKIP: {
convert_n_test("htmldir3", "test --htmldir and --htmlroot 3b",
"--podpath=". catdir($relcwd, 't'),
- "--podroot=$v". File::Spec->rootdir,
+ "--podroot=". catpath($v, '/', ''),
"--htmldir=t",
"--outfile=t/htmldir3.html",
"--quiet",
diff --git a/ext/Pod-Html/t/pod2html-lib.pl b/ext/Pod-Html/t/pod2html-lib.pl
index c60cab6439..42cf1c97c4 100644
--- a/ext/Pod-Html/t/pod2html-lib.pl
+++ b/ext/Pod-Html/t/pod2html-lib.pl
@@ -23,6 +23,7 @@ sub make_test_dir {
}
sub rem_test_dir {
+ return unless -d 'testdir/test.lib';
remove_tree('testdir/test.lib')
or warn "Error removing temporary directory 'testdir/test.lib'";
}
@@ -32,7 +33,9 @@ sub convert_n_test {
my $cwd = Pod::Html::_unixify( Cwd::cwd() );
my ($vol, $dir) = splitpath($cwd, 1);
- my $relcwd = substr($dir, length(File::Spec->rootdir()));
+ my @dirs = splitdir($dir);
+ shift @dirs if $dirs[0] eq '';
+ my $relcwd = join '/', @dirs;
my $new_dir = catdir $dir, "t";
my $infile = catpath $vol, $new_dir, "$podfile.pod";
@@ -48,6 +51,7 @@ sub convert_n_test {
@p2h_args,
);
+ $cwd =~ s|\/$||;
my ($expect, $result);
{