1N/A#!perl
1N/Ause warnings;
1N/Ause strict;
1N/A
1N/ABEGIN {
1N/A chdir 't' if -d 't';
1N/A @INC = '../lib';
1N/A};
1N/A
1N/Ause Test::More tests => 9;
1N/A
1N/Arequire_ok( 'Pod::Select' );
1N/A
1N/Amy $fake_out = tie *FAKEOUT, 'CatchOut';
1N/A
1N/Amy $p_s = Pod::Select->new;
1N/Aisa_ok( $p_s, 'Pod::Select' );
1N/A
1N/Amy $pod = << 'EO_NAME';
1N/A=head1 NAME
1N/A
1N/ASelect.t - Tests for Pod::Select.
1N/A
1N/AEO_NAME
1N/A
1N/A$p_s->select( 'NAME' );
1N/A$p_s->parse_from_file( $0, \*FAKEOUT );
1N/Ais( $$fake_out, $pod, 'select( NAME )' );
1N/A
1N/A$pod .= << 'EO_SYNOPSIS';
1N/A=head1 SYNOPSIS
1N/A
1N/AThis program just tests the basics of the Pod::Select module.
1N/A
1N/AEO_SYNOPSIS
1N/A
1N/A$$fake_out = '';
1N/A$p_s->select( 'NAME', 'SYNOPSIS' );
1N/A$p_s->parse_from_file( $0, \*FAKEOUT );
1N/Ais( $$fake_out, $pod, 'select( NAME, SYNOPSIS )' );
1N/A
1N/A$pod .= << 'EO_AUTHOR';
1N/A=head1 AUTHOR
1N/A
1N/AAbe Timmerman <abe@ztreet.demon.nl>
1N/A
1N/AEO_AUTHOR
1N/A
1N/A$$fake_out = '';
1N/A$p_s->add_selection( 'AUTHOR' );
1N/A$p_s->parse_from_file( $0, \*FAKEOUT );
1N/Ais( $$fake_out, $pod, 'add_selection( AUTHOR )' );
1N/A
1N/Amy $head1 = $p_s->curr_headings(1);
1N/Ais( $head1, 'AUTHOR', 'curr_headings()' );
1N/A
1N/A$pod = << 'EO_DESCRIPTION';
1N/A=head2 subsection
1N/A
1N/Aa sub-section can be specified
1N/A
1N/AEO_DESCRIPTION
1N/A
1N/A$$fake_out = '';
1N/A$p_s->select( 'DESCRIPTION/subsection' );
1N/A$p_s->parse_from_file( $0, \*FAKEOUT );
1N/Ais( $$fake_out, $pod, 'select( DESCRIPTION/subsection )' );
1N/A
1N/A
1N/Aok( $p_s->match_section( 'DESCRIPTION', 'subsection' ),
1N/A 'match_section( DESCRIPTION, subsection )' );
1N/A
1N/A$pod = << 'EO_DESCRIPTION';
1N/A=head1 DESCRIPTION
1N/A
1N/AI'll go by the POD in Pod::Select.
1N/A
1N/AEO_DESCRIPTION
1N/A
1N/A$$fake_out = '';
1N/A$p_s->select( 'DESCRIPTION/!.+' );
1N/A$p_s->parse_from_file( $0, \*FAKEOUT );
1N/Ais( $$fake_out, $pod, 'select( DESCRIPTION/!.+ )' );
1N/A
1N/A
1N/Apackage CatchOut;
1N/Asub TIEHANDLE { bless \( my $self ), shift }
1N/Asub PRINT { my $self = shift; $$self .= $_[0] }
1N/A
1N/A__END__
1N/A
1N/A=head1 NAME
1N/A
1N/ASelect.t - Tests for Pod::Select.
1N/A
1N/A=head1 SYNOPSIS
1N/A
1N/AThis program just tests the basics of the Pod::Select module.
1N/A
1N/A=head1 DESCRIPTION
1N/A
1N/AI'll go by the POD in Pod::Select.
1N/A
1N/A=head2 selection + add_selection
1N/A
1N/APull out the specified sections
1N/A
1N/A=head2 subsection
1N/A
1N/Aa sub-section can be specified
1N/A
1N/A=head1 AUTHOR
1N/A
1N/AAbe Timmerman <abe@ztreet.demon.nl>
1N/A
1N/A=cut