On Fri, Nov 23, 2001 at 02:30:26AM -0800, Russ Allbery wrote:
> Yay, test suite!
>
> The test suite currently doesn't test any of the module options, =for,
> =begin/=end, or some of the other odder edge conditions, but it does test
> all of Pod::Man, Pod::Text, and the three Pod::Text::* sub-modules, as
> well as testing Pod::ParseLink pretty thoroughly. (It compares the
> formatter output against saved output that's been hand-checked, which
> isn't the most ideal testing approach but it's the best idea that we've
> come up with for large-scale translator testing yet.)
>
> Other translator authors may want to look at basic.pod; it's a pretty
> decent torture test of weird things (and patches to make it more of a
> torture test will be happily accepted).
Thanks, applied. Had to corify the basic.t, though (patch attached).
Also, the (out.)cap test is failing for me in tru64 and linux: can
that test hope to be portable?
--
$jhi++; # http://www.iki.fi/jhi/
# There is this special biologist word we use for 'stable'.
# It is 'dead'. -- Jack Cohen
Change 13203 by jhi@alpha on 2001/11/23 15:47:13
Corify podlators 1.14 test.
Affected files ...
.... //depot/perl/lib/Pod/t/basic.t#2 edit
Differences ...
==== //depot/perl/lib/Pod/t/basic.t#2 (text) ====
Index: perl/lib/Pod/t/basic.t
--- perl/lib/Pod/t/basic.t.~1~ Fri Nov 23 18:49:46 2001
+++ perl/lib/Pod/t/basic.t Fri Nov 23 18:49:46 2001
@@ -10,7 +10,11 @@
BEGIN {
chdir 't' if -d 't';
- unshift (@INC, '../blib/lib');
+ if ($ENV{PERL_CORE}) {
+ @INC = '../lib';
+ } else {
+ unshift (@INC, '../blib/lib');
+ }
$| = 1;
print "1..11\n";
}
@@ -42,6 +46,17 @@
# Set default options to match those of pod2man and pod2text.
%options = (sentence => 0);
+sub basic {
+ my $basic = shift;
+ if ($ENV{PERL_CORE}) {
+ require File::Spec;
+ return File::Spec->catfile(File::Spec->catdir(File::Spec->updir,
+ "lib", "Pod", "t"),
+ $basic);
+ }
+ return $basic;
+}
+
my $n = 2;
for (sort keys %translators) {
my $parser = $_->new (%options);
@@ -52,7 +67,7 @@
# line. That means that we don't check those things; oh well. The header
# changes with each version change or touch of the input file.
if ($_ eq 'Pod::Man') {
- $parser->parse_from_file ('basic.pod', 'out.tmp');
+ $parser->parse_from_file (basic("basic.pod"), 'out.tmp');
open (TMP, 'out.tmp') or die "Cannot open out.tmp: $!\n";
open (OUTPUT, "> out.$translators{$_}")
or die "Cannot create out.$translators{$_}: $!\n";
@@ -63,11 +78,11 @@
close TMP;
unlink 'out.tmp';
} else {
- $parser->parse_from_file ('basic.pod', "out.$translators{$_}");
+ $parser->parse_from_file (basic("basic.pod"), "out.$translators{$_}");
}
{
local $/;
- open (MASTER, "basic.$translators{$_}")
+ open (MASTER, basic("basic.$translators{$_}"))
or die "Cannot open basic.$translators{$_}: $!\n";
open (OUTPUT, "out.$translators{$_}")
or die "Cannot open out.$translators{$_}: $!\n";
End of Patch.