line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Synopsis::Expectation::Pod; |
2
|
10
|
|
|
10
|
|
43
|
use strict; |
|
10
|
|
|
|
|
17
|
|
|
10
|
|
|
|
|
344
|
|
3
|
10
|
|
|
10
|
|
44
|
use warnings; |
|
10
|
|
|
|
|
102
|
|
|
10
|
|
|
|
|
289
|
|
4
|
10
|
|
|
10
|
|
39
|
use parent qw/Pod::Simple::Methody/; |
|
10
|
|
|
|
|
11
|
|
|
10
|
|
|
|
|
61
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
sub new { |
7
|
10
|
|
|
10
|
1
|
22
|
my $class = shift; |
8
|
10
|
|
|
|
|
136
|
my $parser = $class->SUPER::new(@_); |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
# NOTE I think not good way... |
11
|
10
|
|
|
|
|
376
|
$parser->{in_head1} = 0; |
12
|
10
|
|
|
|
|
28
|
$parser->{in_synopsis} = 0; |
13
|
10
|
|
|
|
|
23
|
$parser->{in_verbatim} = 0; |
14
|
10
|
|
|
|
|
22
|
$parser->{no_test} = 0; |
15
|
|
|
|
|
|
|
|
16
|
10
|
|
|
|
|
26
|
$parser->{target_codes} = []; |
17
|
|
|
|
|
|
|
|
18
|
10
|
|
|
|
|
108
|
$parser->accept_target_as_text(qw/test_synopsis_expectation_no_test/); |
19
|
|
|
|
|
|
|
|
20
|
10
|
|
|
|
|
370
|
return $parser; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub _handle_text { |
24
|
67
|
|
|
67
|
|
421
|
my($self, $text) = @_; |
25
|
67
|
100
|
100
|
|
|
266
|
if ($self->{in_head1} && $text =~ /^synopsis$/i) { |
26
|
10
|
|
|
|
|
21
|
$self->{in_synopsis} = 1; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
# Target codes (that is synopsis code) |
30
|
67
|
100
|
100
|
|
|
259
|
if ($self->{in_synopsis} && $self->{in_verbatim}) { |
31
|
13
|
100
|
|
|
|
55
|
unless ($self->{no_test}) { |
32
|
12
|
|
|
|
|
17
|
push @{$self->{target_codes}}, $text; |
|
12
|
|
|
|
|
28
|
|
33
|
|
|
|
|
|
|
} |
34
|
13
|
|
|
|
|
37
|
$self->{no_test} = 0; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub _handle_element_start { |
39
|
78
|
|
|
78
|
|
14282
|
my ($self, $element_name, $attr_hash_r) = @_; |
40
|
|
|
|
|
|
|
|
41
|
78
|
100
|
|
|
|
279
|
if ($element_name eq 'head1') { |
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
42
|
30
|
|
|
|
|
45
|
$self->{in_head1} = 1; |
43
|
30
|
|
|
|
|
54
|
$self->{in_synopsis} = 0; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
elsif ($element_name eq 'Verbatim') { |
46
|
13
|
|
|
|
|
33
|
$self->{in_verbatim} = 1; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
elsif ($element_name eq 'for') { |
49
|
1
|
50
|
|
|
|
9
|
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
|
|
637
|
my ($self, $element_name) = @_; |
57
|
|
|
|
|
|
|
|
58
|
78
|
100
|
|
|
|
192
|
if ($element_name eq 'head1') { |
|
|
100
|
|
|
|
|
|
59
|
30
|
|
|
|
|
51
|
$self->{in_head1} = 0; |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
elsif ($element_name eq 'Verbatim') { |
62
|
13
|
|
|
|
|
28
|
$self->{in_verbatim} = 0; |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
1; |