Debian lenny version packages
[pkg-perl] / deb-src / libarchive-zip-perl / libarchive-zip-perl-1.18 / t / 99_author.t
1 #!/usr/bin/perl -w
2
3 use strict;
4 BEGIN {
5         $|  = 1;
6         $^W = 1;
7 }
8 use Test::More;
9
10 # Skip if doing a regular install
11 unless ( $ENV{AUTOMATED_TESTING} ) {
12         plan( skip_all => "Author tests not required for installation" );
13 }
14
15 # Can we run the POD tests?
16 eval "use Test::Pod 1.00";
17 if ( $@ ) {
18         plan( skip_all => "Test::Pod 1.00 required for testing POD" );
19 }
20
21
22
23
24
25 #####################################################################
26 # WARNING: INSANE BLACK MAGIC
27 #####################################################################
28
29 # Hack Pod::Simple::BlackBox to ignore the Test::Inline
30 # "Extended Begin" syntax.
31 # For example, "=begin has more than one word errors"
32 my $begin = \&Pod::Simple::BlackBox::_ponder_begin;
33 sub mybegin {
34         my $para = $_[1];
35         my $content = join ' ', splice @$para, 2;
36         $content =~ s/^\s+//s;
37         $content =~ s/\s+$//s;
38         my @words = split /\s+/, $content;
39         if ( $words[0] =~ /^test(?:ing)?\z/s ) {
40                 foreach ( 2 .. $#$para ) {
41                         $para->[$_] = '';
42                 }
43                 $para->[2] = $words[0];
44         }
45
46         # Continue as normal
47         push @$para, @words;
48         return &$begin(@_);
49 }
50
51 SCOPE: {
52         local $^W = 0;
53         *Pod::Simple::BlackBox::_ponder_begin = \&mybegin;
54 }
55
56 #####################################################################
57 # END BLACK MAGIC
58 #####################################################################
59
60 # Test POD
61 all_pod_files_ok();