This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
don't assume that filesys starts at / in Pod-Html
authorRicardo Signes <rjbs@cpan.org>
Wed, 22 Feb 2012 03:54:58 +0000 (22:54 -0500)
committerRicardo Signes <rjbs@cpan.org>
Wed, 22 Feb 2012 04:42:35 +0000 (23:42 -0500)
The test expectations for the --htmlroot feature wanted to look for
an absolute path, so it concatenated / with the relative-to-root path.

That failed on Win32, where the cwd was C:\etc

I added a new token to the test-expectations-munger for the absolute
cwd.  I'm not 100% sure about the features' behavior, but the tests
are now less platform-specific.  I look forward to input on whether
the code is doing the right thing now...

ext/Pod-Html/t/crossref3.t
ext/Pod-Html/t/pod2html-lib.pl

index fc1983c..309d5ed 100644 (file)
@@ -60,21 +60,21 @@ __DATA__
 
 <p><a href="#section1">&quot;section1&quot;</a></p>
 
-<p><a href="/[RELCURRENTWORKINGDIRECTORY]/t/htmllink.html#section-2">&quot;section 2&quot; in htmllink</a></p>
+<p><a href="[ABSCURRENTWORKINGDIRECTORY]/t/htmllink.html#section-2">&quot;section 2&quot; in htmllink</a></p>
 
 <p><a href="#item1">&quot;item1&quot;</a></p>
 
 <p><a href="#non-existant-section">&quot;non existant section&quot;</a></p>
 
-<p><a href="/[RELCURRENTWORKINGDIRECTORY]/testdir/test.lib/var-copy.html">var-copy</a></p>
+<p><a href="[ABSCURRENTWORKINGDIRECTORY]/testdir/test.lib/var-copy.html">var-copy</a></p>
 
-<p><a href="/[RELCURRENTWORKINGDIRECTORY]/testdir/test.lib/var-copy.html#pod-">&quot;$&quot;&quot; in var-copy</a></p>
+<p><a href="[ABSCURRENTWORKINGDIRECTORY]/testdir/test.lib/var-copy.html#pod-">&quot;$&quot;&quot; in var-copy</a></p>
 
 <p><code>var-copy</code></p>
 
 <p><code>var-copy/$&quot;</code></p>
 
-<p><a href="/[RELCURRENTWORKINGDIRECTORY]/testdir/test.lib/podspec-copy.html#First:">&quot;First:&quot; in podspec-copy</a></p>
+<p><a href="[ABSCURRENTWORKINGDIRECTORY]/testdir/test.lib/podspec-copy.html#First:">&quot;First:&quot; in podspec-copy</a></p>
 
 <p><code>podspec-copy/First:</code></p>
 
index 1567b33..1b2da25 100644 (file)
@@ -56,6 +56,7 @@ sub convert_n_test {
        $expect = <DATA>;
        $expect =~ s/\[PERLADMIN\]/$Config::Config{perladmin}/;
        $expect =~ s/\[RELCURRENTWORKINGDIRECTORY\]/$relcwd/g;
+       $expect =~ s/\[ABSCURRENTWORKINGDIRECTORY\]/$cwd/g;
        if (ord("A") == 193) { # EBCDIC.
            $expect =~ s/item_mat_3c_21_3e/item_mat_4c_5a_6e/;
        }