line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mason::t::Defer; |
2
|
|
|
|
|
|
|
$Mason::t::Defer::VERSION = '2.22'; |
3
|
1
|
|
|
1
|
|
2527
|
use Test::More; |
|
1
|
|
|
|
|
35900
|
|
|
1
|
|
|
|
|
171
|
|
4
|
1
|
|
|
1
|
|
687
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
277
|
|
5
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
32
|
|
6
|
1
|
|
|
1
|
|
7
|
use base qw(Mason::Test::Class); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
2810
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub test_defer : Test(1) { |
9
|
|
|
|
|
|
|
my $self = shift; |
10
|
|
|
|
|
|
|
$self->{interp} = $self->create_interp( plugins => [ '@Default', 'Defer' ] ); |
11
|
|
|
|
|
|
|
$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
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |