line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mason::t::Defer; |
2
|
|
|
|
|
|
|
$Mason::t::Defer::VERSION = '2.24'; |
3
|
1
|
|
|
1
|
|
1297
|
use Test::More; |
|
1
|
|
|
|
|
13924
|
|
|
1
|
|
|
|
|
6
|
|
4
|
1
|
|
|
1
|
|
240
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
28
|
|
5
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
27
|
|
6
|
1
|
|
|
1
|
|
8
|
use base qw(Mason::Test::Class); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
419
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub test_defer : Test(1) { |
9
|
1
|
|
|
1
|
0
|
1142
|
my $self = shift; |
10
|
1
|
|
|
|
|
14
|
$self->{interp} = $self->create_interp( plugins => [ '@Default', 'Defer' ] ); |
11
|
1
|
|
|
|
|
26
|
$self->test_comp( |
12
|
|
|
|
|
|
|
src => <<'EOF', |
13
|
|
|
|
|
|
|
<%class> |
14
|
|
|
|
|
|
|
my ($title, $subtitle); |
15
|
|
|
|
|
|
|
</%class> |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
Title is <% $m->defer(sub { $title }) %> |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
% $.Defer {{ |
20
|
|
|
|
|
|
|
Subtitle is <% $subtitle %> |
21
|
|
|
|
|
|
|
% }} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
<%perl> |
24
|
|
|
|
|
|
|
$title = 'foo'; |
25
|
|
|
|
|
|
|
$subtitle = 'bar'; |
26
|
|
|
|
|
|
|
</%perl> |
27
|
|
|
|
|
|
|
EOF |
28
|
|
|
|
|
|
|
expect => <<'EOF', |
29
|
|
|
|
|
|
|
Title is foo |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
Subtitle is bar |
32
|
|
|
|
|
|
|
EOF |
33
|
|
|
|
|
|
|
); |
34
|
1
|
|
|
1
|
|
8
|
} |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
7
|
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |