dslinux/user/perl/t/pod emptycmd.t emptycmd.xr find.t for.t for.xr headings.t headings.xr include.t include.xr included.t included.xr lref.t lref.xr multiline_items.t multiline_items.xr nested_items.t nested_items.xr nested_seqs.t nested_seqs.xr oneline_cmds.t oneline_cmds.xr plainer.t pod2usage.t pod2usage.xr pod2usage2.t poderrs.t poderrs.xr podselect.t podselect.xr special_seqs.t special_seqs.xr testcmp.pl testp2pt.pl testpchk.pl

cayenne dslinux_cayenne at user.in-berlin.de
Mon Dec 4 18:02:12 CET 2006


Update of /cvsroot/dslinux/dslinux/user/perl/t/pod
In directory antilope:/tmp/cvs-serv17422/t/pod

Added Files:
	emptycmd.t emptycmd.xr find.t for.t for.xr headings.t 
	headings.xr include.t include.xr included.t included.xr lref.t 
	lref.xr multiline_items.t multiline_items.xr nested_items.t 
	nested_items.xr nested_seqs.t nested_seqs.xr oneline_cmds.t 
	oneline_cmds.xr plainer.t pod2usage.t pod2usage.xr 
	pod2usage2.t poderrs.t poderrs.xr podselect.t podselect.xr 
	special_seqs.t special_seqs.xr testcmp.pl testp2pt.pl 
	testpchk.pl 
Log Message:
Adding fresh perl source to HEAD to branch from

--- NEW FILE: headings.xr ---
NAME
    rdb2pg - insert an rdb table into a PostgreSQL database

SYNOPSIS
    rdb2pg [*param*=*value* ...]

PARAMETERS
    rdb2pg uses an IRAF-compatible parameter interface. A template parameter
    file is in /proj/axaf/simul/lib/uparm/rdb2pg.par.

    input *file*
        The RDB file to insert into the database. If the given name is the
        string `stdin', it reads from the UNIX standard input stream.

DESCRIPTION
    rdb2pg will enter the data from an RDB database into a PostgreSQL
    database table, optionally creating the database and the table if they
    do not exist. It automatically determines the PostgreSQL data type from
    the column definition in the RDB file, but may be overriden via a series
    of definition files or directly via one of its parameters.

    The target database and table are specified by the `db' and `table'
    parameters. If they do not exist, and the `createdb' parameter is set,
    they will be created. Table field definitions are determined in the
    following order:


--- NEW FILE: for.xr ---
    This is a test

    pod2text should see this
    and this
    and this

    and everything should see this!

Similarly, this line ...

and this one ...

as well this one,

should all be in pod2text output

    Tweedley-deedley-dee, Im as happy as can be! Tweedley-deedley-dum, cuz
    youre my honey sugar plum!

    The rest of this should show up in everything.


--- NEW FILE: nested_seqs.t ---
BEGIN {
   use File::Basename;
   my $THISDIR = dirname $0;
   unshift @INC, $THISDIR;
   require "testp2pt.pl";
   import TestPodIncPlainText;
}

my %options = map { $_ => 1 } @ARGV;  ## convert cmdline to options-hash
my $passed  = testpodplaintext \%options, $0;
exit( ($passed == 1) ? 0 : -1 )  unless $ENV{HARNESS_ACTIVE};


__END__


=pod

The statement: C<This is dog kind's I<finest> hour!> is a parody of a
quotation from Winston Churchill.

=cut


--- NEW FILE: testcmp.pl ---
package TestCompare;

use vars qw(@ISA @EXPORT $MYPKG);
#use strict;
#use diagnostics;
use Carp;
use Exporter;
use File::Basename;
use File::Spec;
use FileHandle;

@ISA = qw(Exporter);
@EXPORT = qw(&testcmp);
$MYPKG = eval { (caller)[0] };

##--------------------------------------------------------------------------

=head1 NAME

testcmp -- compare two files line-by-line

=head1 SYNOPSIS

    $is_diff = testcmp($file1, $file2);

or

    $is_diff = testcmp({-cmplines => \&mycmp}, $file1, $file2);

=head2 DESCRIPTION

Compare two text files line-by-line and return 0 if they are the
same, 1 if they differ. Each of $file1 and $file2 may be a filenames,
or a filehandles (in which case it must already be open for reading).

If the first argument is a hashref, then the B<-cmplines> key in the
hash may have a subroutine reference as its corresponding value.
The referenced user-defined subroutine should be a line-comparator
function that takes two pre-chomped text-lines as its arguments
(the first is from $file1 and the second is from $file2). It should
return 0 if it considers the two lines equivalent, and non-zero
otherwise.

=cut

##--------------------------------------------------------------------------

sub testcmp( $ $ ; $) {
   my %opts = ref($_[0]) eq 'HASH' ? %{shift()} : ();
   my ($file1, $file2) = @_;
   my ($fh1, $fh2) = ($file1, $file2);
   unless (ref $fh1) {
      $fh1 = FileHandle->new($file1, "r") or die "Can't open $file1: $!";
   }
   unless (ref $fh2) {
      $fh2 = FileHandle->new($file2, "r") or die "Can't open $file2: $!";
   }
  
   my $cmplines = $opts{'-cmplines'} || undef;
   my ($f1text, $f2text) = ("", "");
   my ($line, $diffs)    = (0, 0);
  
   while ( defined($f1text) and defined($f2text) ) {
      defined($f1text = <$fh1>)  and  chomp($f1text);
      defined($f2text = <$fh2>)  and  chomp($f2text);
      ++$line;
      last unless ( defined($f1text) and defined($f2text) );
      $diffs = (ref $cmplines) ? &$cmplines($f1text, $f2text)
                               : ($f1text ne $f2text);
      last if $diffs;
   }
   close($fh1) unless (ref $file1);
   close($fh2) unless (ref $file2);
  
   $diffs = 1  if (defined($f1text) or defined($f2text));
   if ( defined($f1text) and defined($f2text) ) {
      ## these two lines must be different
      warn "$file1 and $file2 differ at line $line\n";
   }
   elsif (defined($f1text)  and  (! defined($f1text))) {
      ## file1 must be shorter
      warn "$file1 is shorter than $file2\n";
   }
   elsif (defined $f2text) {
      ## file2 must be longer
      warn "$file1 is shorter than $file2\n";
   }
   return $diffs;
}

1;

--- NEW FILE: pod2usage.xr ---
###### begin =include pod2usage.PL #####
NAME
    pod2usage - print usage messages from embedded pod docs in files

SYNOPSIS
    pod2usage   [-help] [-man] [-exit *exitval*] [-output *outfile*]
                [-verbose *level*] [-pathlist *dirlist*] *file*

OPTIONS AND ARGUMENTS
    -help   Print a brief help message and exit.

    -man    Print this command's manual page and exit.

    -exit *exitval*
            The exit status value to return.

    -output *outfile*
            The output file to print to. If the special names "-" or ">&1"
            or ">&STDOUT" are used then standard output is used. If ">&2" or
            ">&STDERR" is used then standard error is used.

    -verbose *level*
            The desired level of verbosity to use:

                1 : print SYNOPSIS only
                2 : print SYNOPSIS sections and any OPTIONS/ARGUMENTS sections
                3 : print the entire manpage (similar to running pod2text)

    -pathlist *dirlist*
            Specifies one or more directories to search for the input file
            if it was not supplied with an absolute path. Each directory
            path in the given list should be separated by a ':' on Unix (';'
            on MSWin32 and DOS).

    *file*  The pathname of a file containing pod documentation to be output
            in usage mesage format (defaults to standard input).

DESCRIPTION
    pod2usage will read the given input file looking for pod documentation
    and will print the corresponding usage message. If no input file is
    specifed than standard input is read.

    pod2usage invokes the pod2usage() function in the Pod::Usage module.
    Please see the pod2usage() entry in the Pod::Usage manpage.

SEE ALSO
    the Pod::Usage manpage, the pod2text(1) manpage

AUTHOR
    Please report bugs using http://rt.cpan.org.

    Brad Appleton <bradapp at enteract.com>

    Based on code for pod2text(1) written by Tom Christiansen
    <tchrist at mox.perl.com>

###### end =include pod2usage.PL #####

--- NEW FILE: headings.t ---
BEGIN {
   use File::Basename;
   my $THISDIR = dirname $0;
   unshift @INC, $THISDIR;
   require "testp2pt.pl";
   import TestPodIncPlainText;
}

my %options = map { $_ => 1 } @ARGV;  ## convert cmdline to options-hash
my $passed  = testpodplaintext \%options, $0;
exit( ($passed == 1) ? 0 : -1 )  unless $ENV{HARNESS_ACTIVE};


__END__


#################################################################
  use Pod::Usage;
  pod2usage( VERBOSE => 2, EXIT => 1 );

=pod

=head1 NAME

B<rdb2pg> - insert an rdb table into a PostgreSQL database

=head1 SYNOPSIS

B<rdb2pg>  [I<param>=I<value> ...]

=head1 PARAMETERS

B<rdb2pg> uses an IRAF-compatible parameter interface.  
A template parameter file is in F</proj/axaf/simul/lib/uparm/rdb2pg.par>.

=over 4

=item B<input> I<file>

The B<RDB> file to insert into the database. If the given name
is the string C<stdin>, it reads from the UNIX standard input stream.


=back

=head1 DESCRIPTION

B<rdb2pg> will enter the data from an B<RDB> database into a
PostgreSQL database table, optionally creating the database and the
table if they do not exist.  It automatically determines the
PostgreSQL data type from the column definition in the B<RDB> file,
but may be overriden via a series of definition files or directly
via one of its parameters.

The target database and table are specified by the C<db> and C<table>
parameters.  If they do not exist, and the C<createdb> parameter is
set, they will be created.  Table field definitions are determined
in the following order:

=cut

#################################################################

results in:


#################################################################

    rdb2pg - insert an rdb table into a PostgreSQL database

    rdb2pg [*param*=*value* ...]

    rdb2pg uses an IRAF-compatible parameter interface. A template
    parameter file is in /proj/axaf/simul/lib/uparm/rdb2pg.par.

    The RDB file to insert into the database. If the given name is
    the string `stdin', it reads from the UNIX standard input
    stream.

    rdb2pg will enter the data from an RDB database into a
    PostgreSQL database table, optionally creating the database and
    the table if they do not exist. It automatically determines the
    PostgreSQL data type from the column definition in the RDB file,
    but may be overriden via a series of definition files or
    directly via one of its parameters.

    The target database and table are specified by the `db' and
    `table' parameters. If they do not exist, and the `createdb'
    parameter is set, they will be created. Table field definitions
    are determined in the following order:


#################################################################

while the original version of Text (using pod2text) gives

#################################################################

NAME
    rdb2pg - insert an rdb table into a PostgreSQL database

SYNOPSIS
    rdb2pg [*param*=*value* ...]

PARAMETERS
    rdb2pg uses an IRAF-compatible parameter interface. A template
    parameter file is in /proj/axaf/simul/lib/uparm/rdb2pg.par.

    input *file*
        The RDB file to insert into the database. If the given name
        is the string `stdin', it reads from the UNIX standard input
        stream.

DESCRIPTION
    rdb2pg will enter the data from an RDB database into a
    PostgreSQL database table, optionally creating the database and
    the table if they do not exist. It automatically determines the
    PostgreSQL data type from the column definition in the RDB file,
    but may be overriden via a series of definition files or
    directly via one of its parameters.

    The target database and table are specified by the `db' and
    `table' parameters. If they do not exist, and the `createdb'
    parameter is set, they will be created. Table field definitions
    are determined in the following order:


#################################################################


Thanks for any help.  If, as your email indicates, you've not much
time to look at this, I can work around things by calling pod2text()
directly using the official Text.pm.

Diab

-------------
Diab Jerius
djerius at cfa.harvard.edu


--- NEW FILE: lref.t ---
BEGIN {
   use File::Basename;
   my $THISDIR = dirname $0;
   unshift @INC, $THISDIR;
   require "testp2pt.pl";
   import TestPodIncPlainText;
}

my %options = map { $_ => 1 } @ARGV;  ## convert cmdline to options-hash
my $passed  = testpodplaintext \%options, $0;
exit( ($passed == 1) ? 0 : -1 )  unless $ENV{HARNESS_ACTIVE};


__END__


=pod

Try out I<LOTS> of different ways of specifying references:

Reference the L<manpage/section>

Reference the L<manpage / section>

Reference the L<manpage/ section>

Reference the L<manpage /section>

Reference the L<"manpage/section">

Reference the L<"manpage"/section>

Reference the L<manpage/"section">

Reference the L<manpage/
section>

Reference the L<manpage
/section>

Now try it using the new "|" stuff ...

Reference the L<thistext|manpage/section>

Reference the L<thistext | manpage / section>

Reference the L<thistext| manpage/ section>

Reference the L<thistext |manpage /section>

Reference the L<thistext|
"manpage/section">

Reference the L<thistext
|"manpage"/section>

Reference the L<thistext|manpage/"section">

Reference the L<thistext|
manpage/
section>

Reference the L<thistext
|manpage
/section>


--- NEW FILE: podselect.xr ---
###### begin =include podselect.PL #####
NAME
    podselect - print selected sections of pod documentation on standard
    output

SYNOPSIS
    podselect [-help] [-man] [-section *section-spec*] [*file* ...]

OPTIONS AND ARGUMENTS
    -help   Print a brief help message and exit.

    -man    Print the manual page and exit.

    -section *section-spec*
            Specify a section to include in the output. See the section on
            "SECTION SPECIFICATIONS" in the Pod::Parser manpage for the
            format to use for *section-spec*. This option may be given
            multiple times on the command line.

    *file*  The pathname of a file from which to select sections of pod
            documentation (defaults to standard input).

DESCRIPTION
    podselect will read the given input files looking for pod documentation
    and will print out (in raw pod format) all sections that match one ore
    more of the given section specifications. If no section specifications
    are given than all pod sections encountered are output.

    podselect invokes the podselect() function exported by Pod::Select
    Please see the podselect() entry in the Pod::Select manpage for more
    details.

SEE ALSO
    the Pod::Parser manpage and the Pod::Select manpage

AUTHOR
    Please report bugs using http://rt.cpan.org.

    Brad Appleton <bradapp at enteract.com>

    Based on code for Pod::Text::pod2text(1) written by Tom Christiansen
    <tchrist at mox.perl.com>

###### end =include podselect.PL #####

--- NEW FILE: pod2usage.t ---
BEGIN {
   use File::Basename;
   my $THISDIR = dirname $0;
   unshift @INC, $THISDIR;
   require "testp2pt.pl";
   import TestPodIncPlainText;
}

my %options = map { $_ => 1 } @ARGV;  ## convert cmdline to options-hash
my $passed  = testpodplaintext \%options, $0;
exit( ($passed == 1) ? 0 : -1 )  unless $ENV{HARNESS_ACTIVE};


__END__

=include pod2usage.PL



--- NEW FILE: testp2pt.pl ---
package TestPodIncPlainText;

BEGIN {
   use File::Basename;
   use File::Spec;
   use Cwd qw(abs_path);
   push @INC, '..';
   my $THISDIR = abs_path(dirname $0);
   unshift @INC, $THISDIR;
   require "testcmp.pl";
   import TestCompare;
   my $PARENTDIR = dirname $THISDIR;
   push @INC, map { File::Spec->catfile($_, 'lib') } ($PARENTDIR, $THISDIR);
}

#use strict;
#use diagnostics;
use Carp;
use Exporter;
#use File::Compare;
#use Cwd qw(abs_path);

use vars qw($MYPKG @EXPORT @ISA);
$MYPKG = eval { (caller)[0] };
@EXPORT = qw(&testpodplaintext);
BEGIN {
    require Pod::PlainText;
    @ISA = qw( Pod::PlainText );
    require VMS::Filespec if $^O eq 'VMS';
}

## Hardcode settings for TERMCAP and COLUMNS so we can try to get
## reproducible results between environments
@ENV{qw(TERMCAP COLUMNS)} = ('co=76:do=^J', 76);

sub catfile(@) { File::Spec->catfile(@_); }

my $INSTDIR = abs_path(dirname $0);
$INSTDIR = VMS::Filespec::unixpath($INSTDIR) if $^O eq 'VMS';
$INSTDIR =~ s#/$## if $^O eq 'VMS';
$INSTDIR =~ s#:$## if $^O eq 'MacOS';
$INSTDIR = (dirname $INSTDIR) if (basename($INSTDIR) eq 'pod');
$INSTDIR =~ s#:$## if $^O eq 'MacOS';
$INSTDIR = (dirname $INSTDIR) if (basename($INSTDIR) eq 't');
my @PODINCDIRS = ( catfile($INSTDIR, 'lib', 'Pod'),
                   catfile($INSTDIR, 'scripts'),
                   catfile($INSTDIR, 'pod'),
                   catfile($INSTDIR, 't', 'pod')
                 );

## Find the path to the file to =include
sub findinclude {
    my $self    = shift;
    my $incname = shift;

    ## See if its already found w/out any "searching;
    return  $incname if (-r $incname);

    ## Need to search for it. Look in the following directories ...
    ##   1. the directory containing this pod file
    my $thispoddir = dirname $self->input_file;
    ##   2. the parent directory of the above
    my $parentdir  = dirname $thispoddir;
    my @podincdirs = ($thispoddir, $parentdir, @PODINCDIRS);

    for (@podincdirs) {
       my $incfile = catfile($_, $incname);
       return $incfile  if (-r $incfile);
    }
    warn("*** Can't find =include file $incname in @podincdirs\n");
    return "";
}

sub command {
    my $self = shift;
    my ($cmd, $text, $line_num, $pod_para)  = @_;
    $cmd     = ''  unless (defined $cmd);
    local $_ = $text || '';
    my $out_fh  = $self->output_handle;

    ## Defer to the superclass for everything except '=include'
    return  $self->SUPER::command(@_) unless ($cmd eq "include");

    ## We have an '=include' command
    my $incdebug = 1; ## debugging
    my @incargs = split;
    if (@incargs == 0) {
        warn("*** No filename given for '=include'\n");
        return;
    }
    my $incfile  = $self->findinclude(shift @incargs)  or  return;
    my $incbase  = basename $incfile;
    print $out_fh "###### begin =include $incbase #####\n"  if ($incdebug);
    $self->parse_from_file( {-cutting => 1}, $incfile );
    print $out_fh "###### end =include $incbase #####\n"    if ($incdebug);
}

sub begin_input {
   $_[0]->{_INFILE} = VMS::Filespec::unixify($_[0]->{_INFILE}) if $^O eq 'VMS';
}

sub podinc2plaintext( $ $ ) {
    my ($infile, $outfile) = @_;
    local $_;
    my $text_parser = $MYPKG->new;
    $text_parser->parse_from_file($infile, $outfile);
}

sub testpodinc2plaintext( @ ) {
   my %args = @_;
   my $infile  = $args{'-In'}  || croak "No input file given!";
   my $outfile = $args{'-Out'} || croak "No output file given!";
   my $cmpfile = $args{'-Cmp'} || croak "No compare-result file given!";

   my $different = '';
   my $testname = basename $cmpfile, '.t', '.xr';

   unless (-e $cmpfile) {
      my $msg = "*** Can't find comparison file $cmpfile for testing $infile";
      warn  "$msg\n";
      return  $msg;
   }

   print "# Running testpodinc2plaintext for '$testname'...\n";
   ## Compare the output against the expected result
   podinc2plaintext($infile, $outfile);
   if ( testcmp($outfile, $cmpfile) ) {
       $different = "$outfile is different from $cmpfile";
   }
   else {
       unlink($outfile);
   }
   return  $different;
}

sub testpodplaintext( @ ) {
   my %opts = (ref $_[0] eq 'HASH') ? %{shift()} : ();
   my @testpods = @_;
   my ($testname, $testdir) = ("", "");
   my ($podfile, $cmpfile) = ("", "");
   my ($outfile, $errfile) = ("", "");
   my $passes = 0;
   my $failed = 0;
   local $_;

   print "1..", scalar @testpods, "\n"  unless ($opts{'-xrgen'});

   for $podfile (@testpods) {
      ($testname, $_) = fileparse($podfile);
      $testdir ||=  $_;
      $testname  =~ s/\.t$//;
      $cmpfile   =  $testdir . $testname . '.xr';
      $outfile   =  $testdir . $testname . '.OUT';

      if ($opts{'-xrgen'}) {
          if ($opts{'-force'} or ! -e $cmpfile) {
             ## Create the comparison file
             print "# Creating expected result for \"$testname\"" .
                   " pod2plaintext test ...\n";
             podinc2plaintext($podfile, $cmpfile);
          }
          else {
             print "# File $cmpfile already exists" .
                   " (use '-force' to regenerate it).\n";
          }
          next;
      }

      my $failmsg = testpodinc2plaintext
                        -In  => $podfile,
                        -Out => $outfile,
                        -Cmp => $cmpfile;
      if ($failmsg) {
          ++$failed;
          print "#\tFAILED. ($failmsg)\n";
	  print "not ok ", $failed+$passes, "\n";
      }
      else {
          ++$passes;
          unlink($outfile);
          print "#\tPASSED.\n";
	  print "ok ", $failed+$passes, "\n";
      }
   }
   return  $passes;
}

1;

--- NEW FILE: oneline_cmds.xr ---
NAME
    rdb2pg - insert an rdb table into a PostgreSQL database

SYNOPSIS
    rdb2pg [*param*=*value* ...]

PARAMETERS
    rdb2pg uses an IRAF-compatible parameter interface. A template parameter
    file is in /proj/axaf/simul/lib/uparm/rdb2pg.par.

    input *file*
        The RDB file to insert into the database. If the given name is the
        string `stdin', it reads from the UNIX standard input stream.

DESCRIPTION
    rdb2pg will enter the data from an RDB database into a PostgreSQL
    database table, optionally creating the database and the table if they
    do not exist. It automatically determines the PostgreSQL data type from
    the column definition in the RDB file, but may be overriden via a series
    of definition files or directly via one of its parameters.

    The target database and table are specified by the `db' and `table'
    parameters. If they do not exist, and the `createdb' parameter is set,
    they will be created. Table field definitions are determined in the
    following order:


--- NEW FILE: podselect.t ---
BEGIN {
   use File::Basename;
   my $THISDIR = dirname $0;
   unshift @INC, $THISDIR;
   require "testp2pt.pl";
   import TestPodIncPlainText;
}

my %options = map { $_ => 1 } @ARGV;  ## convert cmdline to options-hash
my $passed  = testpodplaintext \%options, $0;
exit( ($passed == 1) ? 0 : -1 )  unless $ENV{HARNESS_ACTIVE};


__END__

=include podselect.PL



--- NEW FILE: for.t ---
BEGIN {
   use File::Basename;
   my $THISDIR = dirname $0;
   unshift @INC, $THISDIR;
   require "testp2pt.pl";
   import TestPodIncPlainText;
}

my %options = map { $_ => 1 } @ARGV;  ## convert cmdline to options-hash
my $passed  = testpodplaintext \%options, $0;
exit( ($passed == 1) ? 0 : -1 )  unless $ENV{HARNESS_ACTIVE};


__END__


=pod

This is a test

=for theloveofpete
You shouldn't see this
or this
or this

=for text
pod2text should see this
and this
and this

and everything should see this!

=begin text

Similarly, this line ...

and this one ...

as well this one,

should all be in pod2text output

=end text

Tweedley-deedley-dee, Im as happy as can be!
Tweedley-deedley-dum, cuz youre my honey sugar plum!

=begin atthebeginning

But I expect to see neither hide ...

nor tail ...

of this text

=end atthebeginning

The rest of this should show up in everything.


--- NEW FILE: include.t ---
BEGIN {
   use File::Basename;
   my $THISDIR = dirname $0;
   unshift @INC, $THISDIR;
   require "testp2pt.pl";
   import TestPodIncPlainText;
}

my %options = map { $_ => 1 } @ARGV;  ## convert cmdline to options-hash
my $passed  = testpodplaintext \%options, $0;
exit( ($passed == 1) ? 0 : -1 )  unless $ENV{HARNESS_ACTIVE};


__END__


=pod

This file tries to demonstrate a simple =include directive
for pods. It is used as follows:

   =include filename

where "filename" is expected to be an absolute pathname, or else
reside be relative to the directory in which the current processed
podfile resides, or be relative to the current directory.

Lets try it out with the file "included.t" shall we.

***THIS TEXT IS IMMEDIATELY BEFORE THE INCLUDE***

=include included.t

***THIS TEXT IS IMMEDIATELY AFTER THE INCLUDE***

So how did we do???

--- NEW FILE: pod2usage2.t ---
#!/usr/bin/perl -w

use Test::More;

BEGIN {
  if ($^O eq 'MSWin32' || $^O eq 'VMS') {
    plan skip_all => "Not portable on Win32 or VMS\n";
  }
  else {
    plan tests => 15;
  }
  use_ok ("Pod::Usage");
}

sub getoutput
{
  my ($code) = @_;
  my $pid = open(IN, "-|");
  unless(defined $pid) {
    die "Cannot fork: $!";
  }
  if($pid) {
    # parent
    my @out = <IN>;
    close(IN);
    my $exit = $?>>8;
    s/^/#/ for @out;
    local $" = "";
    print "#EXIT=$exit OUTPUT=+++#@out#+++\n";
    return($exit, join("", at out));
  }
  # child
  open(STDERR, ">&STDOUT");
  &$code;
  print "--NORMAL-RETURN--\n";
  exit 0;
}

sub compare
{
  my ($left,$right) = @_;
  $left  =~ s/^#\s+/#/gm;
  $right =~ s/^#\s+/#/gm;
  $left  =~ s/\s+/ /gm;
  $right =~ s/\s+/ /gm;
  $left eq $right;
}

my ($exit, $text) = getoutput( sub { pod2usage() } );
is ($exit, 2,                 "Exit status pod2usage ()");
ok (compare ($text, <<'EOT'), "Output test pod2usage ()");
#Usage:
#    frobnicate [ -r | --recursive ] [ -f | --force ] [ -n number ] file ...
#
EOT

($exit, $text) = getoutput( sub { pod2usage(
  -message => 'You naughty person, what did you say?',
  -verbose => 1 ) });
is ($exit, 1,                 "Exit status pod2usage (-message => '...', -verbose => 1)");
ok (compare ($text, <<'EOT'), "Output test pod2usage (-message => '...', -verbose => 1)");
#You naughty person, what did you say?
# Usage:
#     frobnicate [ -r | --recursive ] [ -f | --force ] [ -n number ] file ...
# 
# Options:
#     -r | --recursive
#         Run recursively.
# 
#     -f | --force
#         Just do it!
# 
#     -n number
#         Specify number of frobs, default is 42.
# 
EOT

($exit, $text) = getoutput( sub { pod2usage(
  -verbose => 2, -exit => 42 ) } );
is ($exit, 42,                "Exit status pod2usage (-verbose => 2, -exit => 42)");
ok (compare ($text, <<'EOT'), "Output test pod2usage (-verbose => 2, -exit => 42)");
#NAME
#     frobnicate - do what I mean
#
# SYNOPSIS
#     frobnicate [ -r | --recursive ] [ -f | --force ] [ -n number ] file ...
#
# DESCRIPTION
#     frobnicate does foo and bar and what not.
#
# OPTIONS
#     -r | --recursive
#         Run recursively.
#
#     -f | --force
#         Just do it!
#
#     -n number
#         Specify number of frobs, default is 42.
#
EOT

($exit, $text) = getoutput( sub { pod2usage(0) } );
is ($exit, 0,                 "Exit status pod2usage (0)");
ok (compare ($text, <<'EOT'), "Output test pod2usage (0)");
#Usage:
#     frobnicate [ -r | --recursive ] [ -f | --force ] [ -n number ] file ...
#
# Options:
#     -r | --recursive
#         Run recursively.
#
#     -f | --force
#         Just do it!
#
#     -n number
#         Specify number of frobs, default is 42.
#
EOT

($exit, $text) = getoutput( sub { pod2usage(42) } );
is ($exit, 42,                "Exit status pod2usage (42)");
ok (compare ($text, <<'EOT'), "Output test pod2usage (42)");
#Usage:
#     frobnicate [ -r | --recursive ] [ -f | --force ] [ -n number ] file ...
#
EOT

($exit, $text) = getoutput( sub { pod2usage(-verbose => 0, -exit => 'NOEXIT') } );
is ($exit, 0,                 "Exit status pod2usage (-verbose => 0, -exit => 'NOEXIT')");
ok (compare ($text, <<'EOT'), "Output test pod2usage (-verbose => 0, -exit => 'NOEXIT')");
#Usage:
#     frobnicate [ -r | --recursive ] [ -f | --force ] [ -n number ] file ...
#
# --NORMAL-RETURN--
EOT

($exit, $text) = getoutput( sub { pod2usage(-verbose => 99, -sections => 'DESCRIPTION') } );
is ($exit, 1,                 "Exit status pod2usage (-verbose => 99, -sections => 'DESCRIPTION')");
ok (compare ($text, <<'EOT'), "Output test pod2usage (-verbose => 99, -sections => 'DESCRIPTION')");
#Description:
#     frobnicate does foo and bar and what not.
#
EOT



__END__

=head1 NAME

frobnicate - do what I mean

=head1 SYNOPSIS

B<frobnicate> S<[ B<-r> | B<--recursive> ]> S<[ B<-f> | B<--force> ]>
  S<[ B<-n> I<number> ]> I<file> ...

=head1 DESCRIPTION

B<frobnicate> does foo and bar and what not.

=head1 OPTIONS

=over 4

=item B<-r> | B<--recursive>

Run recursively.

=item B<-f> | B<--force>

Just do it!

=item B<-n> I<number>

Specify number of frobs, default is 42.

=back

=cut


--- NEW FILE: multiline_items.t ---
BEGIN {
   use File::Basename;
   my $THISDIR = dirname $0;
   unshift @INC, $THISDIR;
   require "testp2pt.pl";
   import TestPodIncPlainText;
}

my %options = map { $_ => 1 } @ARGV;  ## convert cmdline to options-hash
my $passed  = testpodplaintext \%options, $0;
exit( ($passed == 1) ? 0 : -1 )  unless $ENV{HARNESS_ACTIVE};


__END__


=head1 Test multiline item lists

This is a test to ensure that multiline =item paragraphs
get indented appropriately.

=over 4 

=item This 
is
a
test.

=back

=cut

--- NEW FILE: nested_items.xr ---
Test nested item lists
    This is a test to ensure the nested =item paragraphs get indented
    appropriately.

    1 First section.

      a this is item a

      b this is item b

    2 Second section.

      a this is item a

      b this is item b

      c
      d This is item c & d.


--- NEW FILE: lref.xr ---
    Try out *LOTS* of different ways of specifying references:

    Reference the the section entry in the manpage manpage

    Reference the the section entry in the manpage manpage

    Reference the the section entry in the manpage manpage

    Reference the the section entry in the manpage manpage

    Reference the the section on "manpage/section"

    Reference the the section entry in the "manpage" manpage

    Reference the the section on "section" in the manpage manpage

    Reference the the section entry in the manpage manpage

    Reference the the section entry in the manpage manpage

    Now try it using the new "|" stuff ...

    Reference the thistext

    Reference the thistext

    Reference the thistext

    Reference the thistext

    Reference the thistext

    Reference the thistext

    Reference the thistext

    Reference the thistext

    Reference the thistext


--- NEW FILE: nested_items.t ---
BEGIN {
   use File::Basename;
   my $THISDIR = dirname $0;
   unshift @INC, $THISDIR;
   require "testp2pt.pl";
   import TestPodIncPlainText;
}

my %options = map { $_ => 1 } @ARGV;  ## convert cmdline to options-hash
my $passed  = testpodplaintext \%options, $0;
exit( ($passed == 1) ? 0 : -1 )  unless $ENV{HARNESS_ACTIVE};


__END__


=head1 Test nested item lists

This is a test to ensure the nested =item paragraphs
get indented appropriately.

=over 2

=item 1

First section.

=over 2

=item a

this is item a

=item b

this is item b

=back

=item 2

Second section.

=over 2

=item a

this is item a

=item b

this is item b

=item c

=item d

This is item c & d.

=back

=back

=cut

--- NEW FILE: special_seqs.t ---
BEGIN {
   use File::Basename;
   my $THISDIR = dirname $0;
   unshift @INC, $THISDIR;
   require "testp2pt.pl";
   import TestPodIncPlainText;
}

my %options = map { $_ => 1 } @ARGV;  ## convert cmdline to options-hash
my $passed  = testpodplaintext \%options, $0;
exit( ($passed == 1) ? 0 : -1 )  unless $ENV{HARNESS_ACTIVE};


__END__


=pod

This is a test to see if I can do not only C<$self> and C<method()>, but
also C<< $self->method() >> and C<< $self->{FIELDNAME} >> and
C<< $Foo <=> $Bar >> without resorting to escape sequences. If 
I want to refer to the right-shift operator I can do something
like C<<< $x >> 3 >>> or even C<<<< $y >> 5 >>>>.

Now for the grand finale of C<< $self->method()->{FIELDNAME} = {FOO=>BAR} >>.
And I also want to make sure that newlines work like this
C<<<
$self->{FOOBAR} >> 3 and [$b => $a]->[$a <=> $b]
>>>

Of course I should still be able to do all this I<with> escape sequences
too: C<$self-E<gt>method()> and C<$self-E<gt>{FIELDNAME}> and C<{FOO=E<gt>BAR}>.

Dont forget C<$self-E<gt>method()-E<gt>{FIELDNAME} = {FOO=E<gt>BAR}>.

And make sure that C<0> works too!

Now, if I use << or >> as my delimiters, then I have to use whitespace.
So things like C<<$self->method()>> and C<<$self->{FIELDNAME}>> wont end
up doing what you might expect since the first > will still terminate
the first < seen.

Lets make sure these work for empty ones too, like C<<  >> and C<< >> >>
(just to be obnoxious)

=cut

--- NEW FILE: include.xr ---
    This file tries to demonstrate a simple =include directive for pods. It
    is used as follows:

       =include filename

    where "filename" is expected to be an absolute pathname, or else reside
    be relative to the directory in which the current processed podfile
    resides, or be relative to the current directory.

    Lets try it out with the file "included.t" shall we.

    ***THIS TEXT IS IMMEDIATELY BEFORE THE INCLUDE***

###### begin =include included.t #####
    This is the text of the included file named "included.t". It should
    appear in the final pod document from pod2xxx

###### end =include included.t #####
    ***THIS TEXT IS IMMEDIATELY AFTER THE INCLUDE***

    So how did we do???


--- NEW FILE: find.t ---
# Testing of Pod::Find
# Author: Marek Rouchal <marek at saftsack.fs.uni-bayreuth.de>

BEGIN {
  if($ENV{PERL_CORE}) {
    chdir 't' if -d 't';
    # The ../../../../../lib is for finding lib/utf8.pm
    # when running under all-utf8 settings (pod/find.t)
    # does not directly require lib/utf8.pm but regular
    # expressions will need that.
    @INC = qw(../lib ../../../../../lib);
  }
}

$| = 1;

use Test;

BEGIN {
  plan tests => 4;
  use File::Spec;
}

use Pod::Find qw(pod_find pod_where);
use File::Spec;

# load successful
ok(1);

require Cwd;
my $THISDIR = Cwd::cwd();
my $VERBOSE = $ENV{PERL_CORE} ? 0 : ($ENV{TEST_VERBOSE} || 0);
my $lib_dir = $ENV{PERL_CORE} ? 
  File::Spec->catdir('pod', 'testpods', 'lib')
  : File::Spec->catdir($THISDIR,'lib');
if ($^O eq 'VMS') {
    $lib_dir = $ENV{PERL_CORE} ?
      VMS::Filespec::unixify(File::Spec->catdir('pod', 'testpods', 'lib'))
      : VMS::Filespec::unixify(File::Spec->catdir($THISDIR,'-','lib','pod'));
    $Qlib_dir = $lib_dir;
    $Qlib_dir =~ s#\/#::#g;
}

print "### searching $lib_dir\n";
my %pods = pod_find($lib_dir);
my $result = join(',', sort values %pods);
print "### found $result\n";
my $compare = $ENV{PERL_CORE} ? 
  join(',', sort qw(
    Pod::Stuff
))
  : join(',', sort qw(
    Pod::Checker
    Pod::Find
    Pod::InputObjects
    Pod::ParseUtils
    Pod::Parser
    Pod::PlainText
    Pod::Select
    Pod::Usage
));
if ($^O eq 'VMS') {
    $compare = lc($compare);
    my $undollared = $Qlib_dir;
    $undollared =~ s/\$/\\\$/g;
    $undollared =~ s/\-/\\\-/g;
    $result =~ s/$undollared/pod::/g;
    $result =~ s/\$//g;
    my $count = 0;
    my @result = split(/,/,$result);
    my @compare = split(/,/,$compare);
    foreach(@compare) {
        $count += grep {/$_/} @result;
    }
    ok($count/($#result+1)-1,$#compare);
}
elsif (File::Spec->case_tolerant || $^O eq 'dos') {
    ok(lc $result,lc $compare);
}
else {
    ok($result,$compare);
}

print "### searching for File::Find\n";
$result = pod_where({ -inc => 1, -verbose => $VERBOSE }, 'File::Find')
  || 'undef - pod not found!';
print "### found $result\n";

require Config;
if ($^O eq 'VMS') { # privlib is perl_root:[lib] OK but not under mms
    $compare = "lib.File]Find.pm";
    $result =~ s/perl_root:\[\-?\.?//i;
    $result =~ s/\[\-?\.?//i; # needed under `mms test`
    ok($result,$compare);
}
else {
    $compare = $ENV{PERL_CORE} ?
      File::Spec->catfile(File::Spec->updir, 'lib','File','Find.pm')
      : File::Spec->catfile($Config::Config{privlib},"File","Find.pm");
    ok(_canon($result),_canon($compare));
}

# Search for a documentation pod rather than a module
my $searchpod = 'Stuff';
print "### searching for $searchpod.pod\n";
$result = pod_where(
  { -dirs => [ File::Spec->catdir(
    $ENV{PERL_CORE} ? () : qw(t), 'pod', 'testpods', 'lib', 'Pod') ],
    -verbose => $VERBOSE }, $searchpod)
  || "undef - $searchpod.pod not found!";
print "### found $result\n";

$compare = File::Spec->catfile(
    $ENV{PERL_CORE} ? () : qw(t),
    'pod', 'testpods', 'lib', 'Pod' ,'Stuff.pm');
ok(_canon($result),_canon($compare));

# make the path as generic as possible
sub _canon
{
  my ($path) = @_;
  $path = File::Spec->canonpath($path);
  my @comp = File::Spec->splitpath($path);
  my @dir = File::Spec->splitdir($comp[1]);
  $comp[1] = File::Spec->catdir(@dir);
  $path = File::Spec->catpath(@comp);
  $path = uc($path) if File::Spec->case_tolerant;
  print "### general path: $path\n" if $VERBOSE;
  $path;
}


--- NEW FILE: included.xr ---
    This is the text of the included file named "included.t". It should
    appear in the final pod document from pod2xxx


--- NEW FILE: poderrs.xr ---
*** WARNING: =head2 without preceding higher level at line 20 in file t/pod/poderrs.t
*** WARNING: empty section in previous paragraph at line 22 in file t/pod/poderrs.t
*** ERROR: Unknown command 'unknown1' at line 26 in file t/pod/poderrs.t
*** ERROR: Unknown interior-sequence 'Q' at line 30 in file t/pod/poderrs.t
*** ERROR: Unknown interior-sequence 'A' at line 31 in file t/pod/poderrs.t
*** ERROR: Unknown interior-sequence 'Y' at line 32 in file t/pod/poderrs.t
*** ERROR: Unknown interior-sequence 'V' at line 32 in file t/pod/poderrs.t
*** ERROR: unterminated B<...> at line 36 in file t/pod/poderrs.t
*** ERROR: unterminated I<...> at line 35 in file t/pod/poderrs.t
*** ERROR: unterminated C<...> at line 38 in file t/pod/poderrs.t
*** WARNING: line containing nothing but whitespace in paragraph at line 46 in file t/pod/poderrs.t
*** ERROR: =item without previous =over at line 53 in file t/pod/poderrs.t
*** ERROR: =back without previous =over at line 57 in file t/pod/poderrs.t
*** ERROR: =over on line 61 without closing =back (at head2) at line 65 in file t/pod/poderrs.t
*** ERROR: =end without =begin at line 67 in file t/pod/poderrs.t
*** ERROR: Nested =begin's (first at line 71:html) at line 73 in file t/pod/poderrs.t
*** ERROR: =end without =begin at line 77 in file t/pod/poderrs.t
*** ERROR: No argument for =begin at line 83 in file t/pod/poderrs.t
*** ERROR: =for without formatter specification at line 89 in file t/pod/poderrs.t
*** WARNING: nested commands C<...C<...>...> at line 95 in file t/pod/poderrs.t
*** ERROR: garbled entity E<alea iacta est> at line 99 in file t/pod/poderrs.t
*** ERROR: garbled entity E<C<auml>> at line 100 in file t/pod/poderrs.t
*** ERROR: garbled entity E<abcI<bla>> at line 101 in file t/pod/poderrs.t
*** ERROR: Entity number out of range E<0x100> at line 102 in file t/pod/poderrs.t
*** ERROR: Entity number out of range E<07777> at line 103 in file t/pod/poderrs.t
*** ERROR: Entity number out of range E<300> at line 104 in file t/pod/poderrs.t
*** ERROR: malformed link L<> : empty link at line 116 in file t/pod/poderrs.t
*** WARNING: ignoring leading whitespace in link at line 117 in file t/pod/poderrs.t
*** WARNING: ignoring trailing whitespace in link at line 118 in file t/pod/poderrs.t
*** WARNING: (section) in 'passwd(5)' deprecated at line 124 in file t/pod/poderrs.t
*** WARNING: node '$|' contains non-escaped | or / at line 125 in file t/pod/poderrs.t
*** WARNING: alternative text '$|' contains non-escaped | or / at line 125 in file t/pod/poderrs.t
*** ERROR: Spurious character(s) after =back at line 131 in file t/pod/poderrs.t
*** ERROR: Nonempty Z<> at line 145 in file t/pod/poderrs.t
*** ERROR: Empty X<> at line 147 in file t/pod/poderrs.t
*** WARNING: preceding non-item paragraph(s) at line 153 in file t/pod/poderrs.t
*** WARNING: No argument for =item at line 155 in file t/pod/poderrs.t
*** WARNING: previous =item has no contents at line 157 in file t/pod/poderrs.t
*** WARNING: No items in =over (at line 165) / =back list at line 167 in file t/pod/poderrs.t
*** ERROR: Spurious text after =pod at line 173 in file t/pod/poderrs.t
*** ERROR: Spurious text after =cut at line 177 in file t/pod/poderrs.t
*** WARNING: empty section in previous paragraph at line 193 in file t/pod/poderrs.t
*** ERROR: unresolved internal link 'begin or begin' at line 108 in file t/pod/poderrs.t
*** ERROR: unresolved internal link 'end with begin' at line 109 in file t/pod/poderrs.t
*** ERROR: unresolved internal link 'OoPs' at line 110 in file t/pod/poderrs.t
*** ERROR: unresolved internal link 'abc def' at line 114 in file t/pod/poderrs.t
*** ERROR: unresolved internal link 'I/O Operators' at line 202 in file t/pod/poderrs.t

--- NEW FILE: nested_seqs.xr ---
    The statement: `This is dog kind's *finest* hour!' is a parody of a
    quotation from Winston Churchill.


--- NEW FILE: included.t ---
BEGIN {
   use File::Basename;
   my $THISDIR = dirname $0;
   unshift @INC, $THISDIR;
   require "testp2pt.pl";
   import TestPodIncPlainText;
}

my %options = map { $_ => 1 } @ARGV;  ## convert cmdline to options-hash
my $passed  = testpodplaintext \%options, $0;
exit( ($passed == 1) ? 0 : -1 )  unless $ENV{HARNESS_ACTIVE};


__END__


##------------------------------------------------------------
# This file is =included by "include.t"
#
# This text should NOT be in the resultant pod document
# because we havent seen an =xxx pod directive in this file!
##------------------------------------------------------------

=pod

This is the text of the included file named "included.t".
It should appear in the final pod document from pod2xxx

=cut

##------------------------------------------------------------
# This text should NOT be in the resultant pod document
# because it is *after* an =cut an no other pod directives
# proceed it!
##------------------------------------------------------------

--- NEW FILE: testpchk.pl ---
package TestPodChecker;

BEGIN {
   use File::Basename;
   use File::Spec;
   push @INC, '..';
   my $THISDIR = dirname $0;
   unshift @INC, $THISDIR;
   require "testcmp.pl";
   import TestCompare;
   my $PARENTDIR = dirname $THISDIR;
   push @INC, map { File::Spec->catfile($_, 'lib') } ($PARENTDIR, $THISDIR);
   require VMS::Filespec if $^O eq 'VMS';
}

use Pod::Checker;
use vars qw(@ISA @EXPORT $MYPKG);
#use strict;
#use diagnostics;
use Carp;
use Exporter;
#use File::Compare;

@ISA = qw(Exporter);
@EXPORT = qw(&testpodchecker);
$MYPKG = eval { (caller)[0] };

sub stripname( $ ) {
   local $_ = shift;
   return /(\w[.\w]*)\s*$/ ? $1 : $_;
}

sub msgcmp( $ $ ) {
   ## filter out platform-dependent aspects of error messages
   my ($line1, $line2) = @_;
   for ($line1, $line2) {
      ## remove filenames from error messages to avoid any
      ## filepath naming differences between OS platforms
      s/(at line \S+ in file) .*\W(\w+\.[tT])\s*$/$1 \L$2\E/;
      s/.*\W(\w+\.[tT]) (has \d+ pod syntax error)/\L$1\E $2/;
   }
   return ($line1 ne $line2);
}

sub testpodcheck( @ ) {
   my %args = @_;
   my $infile  = $args{'-In'}  || croak "No input file given!";
   my $outfile = $args{'-Out'} || croak "No output file given!";
   my $cmpfile = $args{'-Cmp'} || croak "No compare-result file given!";

   my $different = '';
   my $testname = basename $cmpfile, '.t', '.xr';

   unless (-e $cmpfile) {
      my $msg = "*** Can't find comparison file $cmpfile for testing $infile";
      warn  "$msg\n";
      return  $msg;
   }

   print "# Running podchecker for '$testname'...\n";
   ## Compare the output against the expected result
   if ($^O eq 'VMS') {
      for ($infile, $outfile, $cmpfile) {
         $_ = VMS::Filespec::unixify($_)  unless  ref;
      }
   }
   podchecker($infile, $outfile);
   if ( testcmp({'-cmplines' => \&msgcmp}, $outfile, $cmpfile) ) {
       $different = "$outfile is different from $cmpfile";
   }
   else {
       unlink($outfile);
   }
   return  $different;
}

sub testpodchecker( @ ) {
   my %opts = (ref $_[0] eq 'HASH') ? %{shift()} : ();
   my @testpods = @_;
   my ($testname, $testdir) = ("", "");
   my ($podfile, $cmpfile) = ("", "");
   my ($outfile, $errfile) = ("", "");
   my $passes = 0;
   my $failed = 0;
   local $_;

   print "1..", scalar @testpods, "\n"  unless ($opts{'-xrgen'});

   for $podfile (@testpods) {
      ($testname, $_) = fileparse($podfile);
      $testdir ||=  $_;
      $testname  =~ s/\.t$//;
      $cmpfile   =  $testdir . $testname . '.xr';
      $outfile   =  $testdir . $testname . '.OUT';

      if ($opts{'-xrgen'}) {
          if ($opts{'-force'} or ! -e $cmpfile) {
             ## Create the comparison file
             print "# Creating expected result for \"$testname\"" .
                   " podchecker test ...\n";
             podchecker($podfile, $cmpfile);
          }
          else {
             print "# File $cmpfile already exists" .
                   " (use '-force' to regenerate it).\n";
          }
          next;
      }

      my $failmsg = testpodcheck
                        -In  => $podfile,
                        -Out => $outfile,
                        -Cmp => $cmpfile;
      if ($failmsg) {
          ++$failed;
          print "#\tFAILED. ($failmsg)\n";
	  print "not ok ", $failed+$passes, "\n";
      }
      else {
          ++$passes;
          unlink($outfile);
          print "#\tPASSED.\n";
	  print "ok ", $failed+$passes, "\n";
      }
   }
   return  $passes;
}

1;

--- NEW FILE: plainer.t ---
#!./perl

BEGIN { chdir 't' if -d 't'; @INC = '../lib' }

use Pod::Plainer;
my $parser = Pod::Plainer->new();
my $header = "=pod\n\n";
my $input  = 'plnr_in.pod';
my $output = 'plnr_out.pod';

my $test = 0;
print "1..7\n";
while( <DATA> ) {
    my $expected = $header.<DATA>; 

    open(IN, '>', $input) or die $!;
    print IN $header, $_;
    close IN or die $!;

    open IN, '<', $input or die $!;
    open OUT, '>', $output or die $!;
    $parser->parse_from_filehandle(\*IN,\*OUT);

    open OUT, '<', $output or die $!;
    my $returned; { local $/; $returned = <OUT>; }
    
    unless( $returned eq $expected ) {
       print map { s/^/\#/mg; $_; }
               map {+$_}               # to avoid readonly values
                   "EXPECTED:\n", $expected, "GOT:\n", $returned;
       print "not ";
    }
    printf "ok %d\n", ++$test; 
    close OUT;
    close IN;
}

END { 
    1 while unlink $input;
    1 while unlink $output;
}

__END__
=head <> now reads in records
=head E<lt>E<gt> now reads in records
=item C<-T> and C<-B> not implemented on filehandles
=item C<-T> and C<-B> not implemented on filehandles
e.g. C<< Foo->bar() >> or C<< $obj->bar() >>
e.g. C<Foo-E<gt>bar()> or C<$obj-E<gt>bar()>
The C<< => >> operator is mostly just a more visually distinctive
The C<=E<gt>> operator is mostly just a more visually distinctive
C<uv < 0x80> in which case you can use C<*s = uv>.
C<uv E<lt> 0x80> in which case you can use C<*s = uv>.
C<time ^ ($$ + ($$ << 15))>), but that isn't necessary any more.
C<time ^ ($$ + ($$ E<lt>E<lt> 15))>), but that isn't necessary any more.
The bitwise operation C<<< >> >>>
The bitwise operation C<E<gt>E<gt>>

--- NEW FILE: emptycmd.t ---
BEGIN {
   use File::Basename;
   my $THISDIR = dirname $0;
   unshift @INC, $THISDIR;
   require "testp2pt.pl";
   import TestPodIncPlainText;
}

my %options = map { $_ => 1 } @ARGV;  ## convert cmdline to options-hash
my $passed  = testpodplaintext \%options, $0;
exit( ($passed == 1) ? 0 : -1 )  unless $ENV{HARNESS_ACTIVE};

__END__

=pod

= this is a test
of the emergency
broadcast system

=cut

--- NEW FILE: oneline_cmds.t ---
BEGIN {
   use File::Basename;
   my $THISDIR = dirname $0;
   unshift @INC, $THISDIR;
   require "testp2pt.pl";
   import TestPodIncPlainText;
}

my %options = map { $_ => 1 } @ARGV;  ## convert cmdline to options-hash
my $passed  = testpodplaintext \%options, $0;
exit( ($passed == 1) ? 0 : -1 )  unless $ENV{HARNESS_ACTIVE};


__END__


==head1 NAME
B<rdb2pg> - insert an rdb table into a PostgreSQL database

==head1 SYNOPSIS
B<rdb2pg>  [I<param>=I<value> ...]

==head1 PARAMETERS
B<rdb2pg> uses an IRAF-compatible parameter interface.  
A template parameter file is in F</proj/axaf/simul/lib/uparm/rdb2pg.par>.

==over 4
==item B<input> I<file>
The B<RDB> file to insert into the database. If the given name
is the string C<stdin>, it reads from the UNIX standard input stream.

==back

==head1 DESCRIPTION
B<rdb2pg> will enter the data from an B<RDB> database into a
PostgreSQL database table, optionally creating the database and the
table if they do not exist.  It automatically determines the
PostgreSQL data type from the column definition in the B<RDB> file,
but may be overriden via a series of definition files or directly
via one of its parameters.

The target database and table are specified by the C<db> and C<table>
parameters.  If they do not exist, and the C<createdb> parameter is
set, they will be created.  Table field definitions are determined
in the following order:


--- NEW FILE: special_seqs.xr ---
    This is a test to see if I can do not only `$self' and `method()', but
    also `$self->method()' and `$self->{FIELDNAME}' and `$Foo <=> $Bar'
    without resorting to escape sequences. If I want to refer to the
    right-shift operator I can do something like `$x >> 3' or even `$y >>
    5'.

    Now for the grand finale of `$self->method()->{FIELDNAME} = {FOO=>BAR}'.
    And I also want to make sure that newlines work like this
    `$self->{FOOBAR} >> 3 and [$b => $a]->[$a <=> $b]'

    Of course I should still be able to do all this *with* escape sequences
    too: `$self->method()' and `$self->{FIELDNAME}' and `{FOO=>BAR}'.

    Dont forget `$self->method()->{FIELDNAME} = {FOO=>BAR}'.

    And make sure that `0' works too!

    Now, if I use << or >> as my delimiters, then I have to use whitespace.
    So things like `<$self-'method()>> and `<$self-'{FIELDNAME}>> wont end
    up doing what you might expect since the first > will still terminate
    the first < seen.

    Lets make sure these work for empty ones too, like and `>>' (just to be
    obnoxious)


--- NEW FILE: poderrs.t ---
BEGIN {
   use File::Basename;
   my $THISDIR = dirname $0;
   unshift @INC, $THISDIR;
   require "testpchk.pl";
   import TestPodChecker;
}

my %options = map { $_ => 1 } @ARGV;  ## convert cmdline to options-hash
my $passed  = testpodchecker \%options, $0;
exit( ($passed == 1) ? 0 : -1 )  unless $ENV{HARNESS_ACTIVE};

### Deliberately throw in some blank but non-empty lines
                                        
### The above line should contain spaces


__END__

=head2 This should cause a warning

=head1 NAME

poderrors.t - test Pod::Checker on some pod syntax errors

=unknown1 this is an unknown command with two N<unknownA>
and D<unknownB> interior sequences.

This is some paragraph text with some unknown interior sequences,
such as Q<unknown2>,
A<unknown3>,
and Y<unknown4 V<unknown5>>.

Now try some unterminated sequences like
I<hello mudda!
B<hello fadda!

Here I am at C<camp granada!

Camps is very,
entertaining.
And they say we'll have some fun if it stops raining!

Okay, now use a non-empty blank line to terminate a paragraph and make
sure we get a warning.
	                                     	
The above blank line contains tabs and spaces only

=head1 Additional tests

=head2 item without over

=item oops

=head2 back without over

=back

=head2 over without back

=over 4

=item aaps

=head2 end without begin

=end

=head2 begin and begin

=begin html

=begin text

=end

=end

second one results in end w/o begin

=head2 begin w/o formatter

=begin

=end

=head2 for w/o formatter

=for

something...

=head2 Nested sequences of the same type

C<code I<italic C<code again!>>>

=head2 Garbled entities

E<alea iacta est>
E<C<auml>>
E<abcI<bla>>
E<0x100>
E<07777>
E<300>

=head2 Unresolved internal links

L</"begin or begin">
L<"end with begin">
L</OoPs>

=head2 Some links with problems

L<abc
def>
L<>
L<   aha>
L<oho   >
L<"Warnings"> this one is ok
L</unescaped> ok too, this POD has an X of the same name

=head2 Warnings

L<passwd(5)>
L<some text with / in it|perlvar/$|> should give warnings as hell

=over 4

=item bla

=back 200

the 200 is evil

=begin html

What?

=end xml

X<unescaped>see these unescaped < and > in the text?

=head2 Misc

Z<ddd> should be empty

X<> should not be empty

=over four

This paragrapgh is misplaced - it ought to be an item.

=item four should be numeric!

=item

=item blah

=item previous is all empty!!!

=back

All empty over/back:

=over 4

=back

item w/o name

=cut

=pod bla

bla is evil

=cut blub

blub is evil

=head2 reoccurence

=over 4

=item Misc

we already have a head Misc

=back

=head2 some heading

=head2 another one

previous section is empty!

=head1 LINK TESTS

Due to bug reported by Rafael Garcia-Suarez "rgarciasuarez at free.fr":

The following hyperlinks :
L<"I/O Operators">
L<perlop/"I/O Operators">
trigger a podchecker warning (using bleadperl) :
    node 'I/O Operators' contains non-escaped | or /

=cut



--- NEW FILE: emptycmd.xr ---
    = this is a test of the emergency broadcast system


--- NEW FILE: multiline_items.xr ---
Test multiline item lists
    This is a test to ensure that multiline =item paragraphs get indented
    appropriately.

    This is a test.




More information about the dslinux-commit mailing list