File Coverage

blib/lib/Mason/t/Compilation.pm
Criterion Covered Total %
statement 18 18 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod 0 1 0.0
total 22 23 95.6


line stmt bran cond sub pod time code
1             package Mason::t::Compilation;
2             $Mason::t::Compilation::VERSION = '2.24';
3 1     1   1098 use Test::Class::Most parent => 'Mason::Test::Class';
  1         42318  
  1         8  
4              
5             sub test_pure_perl : Tests {
6 1     1 0 609 my $self = shift;
7              
8             my $std =
9 1     5   4 sub { my $num = shift; sprintf( 'method main () { my $foo = %s; print $foo; }', $num ) };
  5         8  
  5         42  
10              
11 1         3 $self->add_comp( path => '/print1.pl', src => $std->(53) );
12 1         2 $self->test_comp(
13             path => '/top1.mp',
14             src => 'method main () { $m->comp("/print1.pl") }',
15             expect => $std->(53),
16             );
17              
18 1         9 $self->setup_interp( pure_perl_extensions => ['.pl'] );
19 1         28 $self->add_comp( path => '/print2.pl', src => $std->(54) );
20 1         5 $self->test_comp( path => '/top2.mp', src => '<& print2.pl &>', expect => '54' );
21              
22 1         6 $self->setup_interp( pure_perl_extensions => [] );
23 1         23 $self->add_comp( path => '/print3.pl', src => $std->(55) );
24 1         5 $self->test_comp(
25             path => '/top3.mp',
26             src => '<& print3.pl &>',
27             expect => $std->(55),
28             );
29 1     1   190 }
  1         2  
  1         5  
30              
31             1;