line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Synopsis::Expectation::Pod; |
2
|
10
|
|
|
10
|
|
58
|
use strict; |
|
10
|
|
|
|
|
21
|
|
|
10
|
|
|
|
|
364
|
|
3
|
10
|
|
|
10
|
|
52
|
use warnings; |
|
10
|
|
|
|
|
105
|
|
|
10
|
|
|
|
|
301
|
|
4
|
10
|
|
|
10
|
|
48
|
use parent qw/Pod::Simple::Methody/; |
|
10
|
|
|
|
|
15
|
|
|
10
|
|
|
|
|
115
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
sub new { |
7
|
10
|
|
|
10
|
1
|
31
|
my $class = shift; |
8
|
10
|
|
|
|
|
164
|
my $parser = $class->SUPER::new(@_); |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
# NOTE I think not good way... |
11
|
10
|
|
|
|
|
573
|
$parser->{in_head1} = 0; |
12
|
10
|
|
|
|
|
31
|
$parser->{in_synopsis} = 0; |
13
|
10
|
|
|
|
|
27
|
$parser->{in_verbatim} = 0; |
14
|
10
|
|
|
|
|
26
|
$parser->{no_test} = 0; |
15
|
|
|
|
|
|
|
|
16
|
10
|
|
|
|
|
36
|
$parser->{target_codes} = []; |
17
|
|
|
|
|
|
|
|
18
|
10
|
|
|
|
|
189
|
$parser->accept_target_as_text(qw/test_synopsis_expectation_no_test/); |
19
|
|
|
|
|
|
|
|
20
|
10
|
|
|
|
|
308
|
return $parser; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub _handle_text { |
24
|
67
|
|
|
67
|
|
573
|
my($self, $text) = @_; |
25
|
67
|
100
|
100
|
|
|
331
|
if ($self->{in_head1} && $text =~ /^synopsis$/i) { |
26
|
10
|
|
|
|
|
25
|
$self->{in_synopsis} = 1; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
# Target codes (that is synopsis code) |
30
|
67
|
100
|
100
|
|
|
333
|
if ($self->{in_synopsis} && $self->{in_verbatim}) { |
31
|
13
|
100
|
|
|
|
71
|
unless ($self->{no_test}) { |
32
|
12
|
|
|
|
|
29
|
push @{$self->{target_codes}}, $text; |
|
12
|
|
|
|
|
43
|
|
33
|
|
|
|
|
|
|
} |
34
|
13
|
|
|
|
|
44
|
$self->{no_test} = 0; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub _handle_element_start { |
39
|
78
|
|
|
78
|
|
17240
|
my ($self, $element_name, $attr_hash_r) = @_; |
40
|
|
|
|
|
|
|
|
41
|
78
|
100
|
|
|
|
399
|
if ($element_name eq 'head1') { |
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
42
|
30
|
|
|
|
|
58
|
$self->{in_head1} = 1; |
43
|
30
|
|
|
|
|
79
|
$self->{in_synopsis} = 0; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
elsif ($element_name eq 'Verbatim') { |
46
|
13
|
|
|
|
|
48
|
$self->{in_verbatim} = 1; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
elsif ($element_name eq 'for') { |
49
|
1
|
50
|
|
|
|
5
|
if ($attr_hash_r->{target} eq 'test_synopsis_expectation_no_test') { |
50
|
1
|
|
|
|
|
4
|
$self->{no_test} = 1; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub _handle_element_end { |
56
|
78
|
|
|
78
|
|
768
|
my ($self, $element_name) = @_; |
57
|
|
|
|
|
|
|
|
58
|
78
|
100
|
|
|
|
260
|
if ($element_name eq 'head1') { |
|
|
100
|
|
|
|
|
|
59
|
30
|
|
|
|
|
78
|
$self->{in_head1} = 0; |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
elsif ($element_name eq 'Verbatim') { |
62
|
13
|
|
|
|
|
44
|
$self->{in_verbatim} = 0; |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
1; |