line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mason::t::Sections; |
2
|
|
|
|
|
|
|
$Mason::t::Sections::VERSION = '2.24'; |
3
|
1
|
|
|
1
|
|
777
|
use Test::Class::Most parent => 'Mason::Test::Class'; |
|
1
|
|
|
|
|
32213
|
|
|
1
|
|
|
|
|
6
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
sub test_sections : Tests { |
6
|
1
|
|
|
1
|
0
|
189
|
my $self = shift; |
7
|
1
|
|
|
|
|
6
|
$self->test_comp( |
8
|
|
|
|
|
|
|
src => <<'EOF', |
9
|
|
|
|
|
|
|
<%doc> |
10
|
|
|
|
|
|
|
This should not get printed. |
11
|
|
|
|
|
|
|
</%doc> |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
<%init> |
14
|
|
|
|
|
|
|
my $init_message = $self->init_message(); |
15
|
|
|
|
|
|
|
</%init> |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
<%class> |
18
|
|
|
|
|
|
|
my $class_message = "class message"; |
19
|
|
|
|
|
|
|
method init_message () { "init message" } |
20
|
|
|
|
|
|
|
</%class> |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
<BODY> |
23
|
|
|
|
|
|
|
<% $class_message %> |
24
|
|
|
|
|
|
|
% $self->method_call(); |
25
|
|
|
|
|
|
|
<% $self->method_call_with_arglist(3, 4) %> |
26
|
|
|
|
|
|
|
<%perl> |
27
|
|
|
|
|
|
|
print "$init_message\n"; |
28
|
|
|
|
|
|
|
</%perl> |
29
|
|
|
|
|
|
|
</BODY> |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
<%method method_call> |
32
|
|
|
|
|
|
|
<% $message %> |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
<%init> |
35
|
|
|
|
|
|
|
my $message = "message"; |
36
|
|
|
|
|
|
|
</%init> |
37
|
|
|
|
|
|
|
</%method> |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
<%before method_call> |
40
|
|
|
|
|
|
|
before method call |
41
|
|
|
|
|
|
|
</%before> |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
<%after method_call> |
44
|
|
|
|
|
|
|
after method call |
45
|
|
|
|
|
|
|
</%after> |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
<%override render> |
48
|
|
|
|
|
|
|
start override |
49
|
|
|
|
|
|
|
<% super() %> |
50
|
|
|
|
|
|
|
end override |
51
|
|
|
|
|
|
|
</%override> |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
<%method method_call_with_arglist ($foo, $bar)> |
54
|
|
|
|
|
|
|
<% $foo %> - <% $bar %> |
55
|
|
|
|
|
|
|
</%method> |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
EOF |
58
|
|
|
|
|
|
|
expect => <<'EOF', |
59
|
|
|
|
|
|
|
start override |
60
|
|
|
|
|
|
|
<BODY> |
61
|
|
|
|
|
|
|
class message |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
before method call |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
message |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
after method call |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
3 - 4 |
70
|
|
|
|
|
|
|
init message |
71
|
|
|
|
|
|
|
</BODY> |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
end override |
74
|
|
|
|
|
|
|
EOF |
75
|
|
|
|
|
|
|
); |
76
|
1
|
|
|
1
|
|
107
|
} |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
4
|
|
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
sub test_perl_section_newlines : Tests { |
79
|
1
|
|
|
1
|
0
|
192
|
my $self = shift; |
80
|
1
|
|
|
|
|
6
|
$self->test_comp( |
81
|
|
|
|
|
|
|
src => <<'EOF', |
82
|
|
|
|
|
|
|
1<%perl>print "2\n";</%perl> |
83
|
|
|
|
|
|
|
<%perl> |
84
|
|
|
|
|
|
|
print "3\n"; |
85
|
|
|
|
|
|
|
</%perl> |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
4 |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
<%perl> |
90
|
|
|
|
|
|
|
print "5\n"; |
91
|
|
|
|
|
|
|
</%perl> |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
6 |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
<%perl> |
98
|
|
|
|
|
|
|
print "7\n"; |
99
|
|
|
|
|
|
|
</%perl> |
100
|
|
|
|
|
|
|
EOF |
101
|
|
|
|
|
|
|
expect => <<'EOF', |
102
|
|
|
|
|
|
|
12 |
103
|
|
|
|
|
|
|
3 |
104
|
|
|
|
|
|
|
4 |
105
|
|
|
|
|
|
|
5 |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
6 |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
7 |
110
|
|
|
|
|
|
|
EOF |
111
|
|
|
|
|
|
|
); |
112
|
1
|
|
|
1
|
|
231
|
} |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
2
|
|
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
sub test_text_section : Tests { |
115
|
1
|
|
|
1
|
0
|
201
|
my $self = shift; |
116
|
1
|
|
|
|
|
7
|
$self->test_comp( |
117
|
|
|
|
|
|
|
src => <<'EOF', |
118
|
|
|
|
|
|
|
<%text> |
119
|
|
|
|
|
|
|
% |
120
|
|
|
|
|
|
|
<%init> |
121
|
|
|
|
|
|
|
<%doc> |
122
|
|
|
|
|
|
|
<% $x %> |
123
|
|
|
|
|
|
|
</%text> |
124
|
|
|
|
|
|
|
EOF |
125
|
|
|
|
|
|
|
expect => <<'EOF', |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
% |
128
|
|
|
|
|
|
|
<%init> |
129
|
|
|
|
|
|
|
<%doc> |
130
|
|
|
|
|
|
|
<% $x %> |
131
|
|
|
|
|
|
|
EOF |
132
|
|
|
|
|
|
|
); |
133
|
1
|
|
|
1
|
|
206
|
} |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
4
|
|
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
sub test_empty_sections : Tests { |
136
|
1
|
|
|
1
|
0
|
914
|
my $self = shift; |
137
|
1
|
|
|
|
|
8
|
$self->test_comp( |
138
|
|
|
|
|
|
|
src => ' |
139
|
|
|
|
|
|
|
hi |
140
|
|
|
|
|
|
|
<%after foo></%after> |
141
|
|
|
|
|
|
|
<%around foo></%around> |
142
|
|
|
|
|
|
|
<%before foo></%before> |
143
|
|
|
|
|
|
|
<%method foo></%method> |
144
|
|
|
|
|
|
|
<%filter bar></%filter> |
145
|
|
|
|
|
|
|
<%override allow_path_info></%override> |
146
|
|
|
|
|
|
|
<%class></%class> |
147
|
|
|
|
|
|
|
<%doc></%doc> |
148
|
|
|
|
|
|
|
<%flags></%flags> |
149
|
|
|
|
|
|
|
<%init></%init> |
150
|
|
|
|
|
|
|
<%perl></%perl> |
151
|
|
|
|
|
|
|
<%text></%text> |
152
|
|
|
|
|
|
|
bye |
153
|
|
|
|
|
|
|
', |
154
|
|
|
|
|
|
|
expect => "hibye", |
155
|
|
|
|
|
|
|
); |
156
|
1
|
|
|
1
|
|
204
|
} |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
3
|
|
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
1; |