~ubuntu-branches/ubuntu/hardy/libyaml-tiny-perl/hardy

« back to all changes in this revision

Viewing changes to t/98_pod.t

  • Committer: Bazaar Package Importer
  • Author(s): John Lightsey
  • Date: 2007-11-20 20:56:00 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20071120205600-lw0eukfw3z9nccec
Tags: 1.20-1
* New upstream release
* Remove build-depends-indep on libmodule-install-perl
* Update homepage link in debian/control

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/perl
 
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
# Load the testing modules if we can
 
16
eval "use Test::Pod 1.00";
 
17
if ( $@ ) {
 
18
        plan( skip_all => "Test::Pod not available for testing" );
 
19
}
 
20
 
 
21
all_pod_files_ok();
 
22
exit(0);
 
23
 
 
24
 
 
25
 
 
26
 
 
27
 
 
28
#####################################################################
 
29
# WARNING: INSANE BLACK MAGIC
 
30
#####################################################################
 
31
 
 
32
# Hack Pod::Simple::BlackBox to ignore the Test::Inline
 
33
# "Extended Begin" syntax.
 
34
# For example, "=begin has more than one word errors"
 
35
my $begin;
 
36
if ( $Test::Pod::VERSION ) {
 
37
        $begin = \&Pod::Simple::BlackBox::_ponder_begin;
 
38
}
 
39
sub mybegin {
 
40
        my $para = $_[1];
 
41
        my $content = join ' ', splice @$para, 2;
 
42
        $content =~ s/^\s+//s;
 
43
        $content =~ s/\s+$//s;
 
44
        my @words = split /\s+/, $content;
 
45
        if ( $words[0] =~ /^test(?:ing)?\z/s ) {
 
46
                foreach ( 2 .. $#$para ) {
 
47
                        $para->[$_] = '';
 
48
                }
 
49
                $para->[2] = $words[0];
 
50
        }
 
51
 
 
52
        # Continue as normal
 
53
        push @$para, @words;
 
54
        return &$begin(@_);
 
55
}
 
56
 
 
57
SCOPE: {
 
58
        local $^W = 0;
 
59
        if ( $Test::Pod::VERSION ) {
 
60
                *Pod::Simple::BlackBox::_ponder_begin = \&mybegin;
 
61
        }
 
62
}
 
63
 
 
64
#####################################################################
 
65
# END BLACK MAGIC
 
66
#####################################################################
 
67