line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Inline::Content::Default; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=pod |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=head1 NAME |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
Test::Inline::Content::Default - Test::Inline 2 fallback/default Content Handler |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 DESCRIPTION |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
This class implements the default generator for script content. It generates |
12
|
|
|
|
|
|
|
test script content inteded for use in a standard CPAN dist. |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
This module contains no user servicable parts. |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=cut |
17
|
|
|
|
|
|
|
|
18
|
12
|
|
|
12
|
|
1341
|
use strict; |
|
12
|
|
|
|
|
22
|
|
|
12
|
|
|
|
|
450
|
|
19
|
12
|
|
|
12
|
|
75
|
use Params::Util qw{_INSTANCE}; |
|
12
|
|
|
|
|
22
|
|
|
12
|
|
|
|
|
493
|
|
20
|
12
|
|
|
12
|
|
60
|
use Test::Inline::Content (); |
|
12
|
|
|
|
|
22
|
|
|
12
|
|
|
|
|
231
|
|
21
|
|
|
|
|
|
|
|
22
|
12
|
|
|
12
|
|
55
|
use vars qw{$VERSION @ISA}; |
|
12
|
|
|
|
|
23
|
|
|
12
|
|
|
|
|
687
|
|
23
|
|
|
|
|
|
|
BEGIN { |
24
|
12
|
|
|
12
|
|
23
|
$VERSION = '2.213'; |
25
|
12
|
|
|
|
|
2045
|
@ISA = 'Test::Inline::Content'; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub process { |
29
|
16
|
|
|
16
|
1
|
1138
|
my $self = shift; |
30
|
16
|
50
|
|
|
|
126
|
my $Inline = _INSTANCE(shift, 'Test::Inline') or return undef; |
31
|
16
|
50
|
|
|
|
306
|
my $Script = _INSTANCE(shift, 'Test::Inline::Script') or return undef; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
# Get the merged content |
34
|
16
|
|
|
|
|
65
|
my $content = $Script->merged_content; |
35
|
16
|
50
|
|
|
|
45
|
return undef unless defined $content; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
# Determine a plan |
38
|
16
|
|
|
|
|
55
|
my $tests = $Script->tests; |
39
|
16
|
100
|
|
|
|
56
|
my $plan = defined $tests |
40
|
|
|
|
|
|
|
? "tests => $tests" |
41
|
|
|
|
|
|
|
: "'no_plan'"; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
# Wrap the merged contents with the rest of the test |
44
|
|
|
|
|
|
|
# file infrastructure. |
45
|
16
|
|
|
|
|
59
|
my $file = <<"END_TEST"; |
46
|
|
|
|
|
|
|
#!/usr/bin/perl -w |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
use strict; |
49
|
|
|
|
|
|
|
use Test::More $plan; |
50
|
|
|
|
|
|
|
\$| = 1; |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
$content |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
1; |
59
|
|
|
|
|
|
|
END_TEST |
60
|
|
|
|
|
|
|
|
61
|
16
|
|
|
|
|
47
|
$file; |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
1; |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=pod |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head1 SUPPORT |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
See the main L section. |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=head1 AUTHOR |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
Adam Kennedy Eadamk@cpan.orgE, L |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=head1 COPYRIGHT |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
Copyright 2004 - 2013 Adam Kennedy. |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
This program is free software; you can redistribute |
81
|
|
|
|
|
|
|
it and/or modify it under the same terms as Perl itself. |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
The full text of the license can be found in the |
84
|
|
|
|
|
|
|
LICENSE file included with this module. |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=cut |