use Devel::Cover::TT qw{ -silent 1 -ignore . }; |
[% title %][% ' - ' _ subtitle IF subtitle %] ~~~~ [% PROCESS show_rows IF verbose && rows.size > 0 %] ~~~~ [% BLOCK show_rows %] [% FOREACH row = rows -%] [% row.x %] / [% row.y %] = [% row.y == 0 ? 'N/A' : ( row.x / row.y ) %] [% END -%] [% END %]
Input for first test:{ title => 'Test1', verbose => 0, rows => [ { x => 1, y => 2, }, { x => 2, y => 4, }, ], };Output from first test |
Coverage wjust first test |
Input for second test:{ title => 'Test2', subtitle => 'second test', verbose => 1, rows => [ { x => 1, y => 2, }, { x => 3, y => 0, }, { x => 2, y => 4, }, ], };Output from second test |
Coverage w/both tests |
save to cache -- file has contents: Template::Document->new( .... ); read from cache: $foo = require $cachefileto this:
save to cache -- file has contents: package blah::blah::blah::template_name_tmpl.pm; sub getDocument { Template::Document->new( .... ); } 1; read from cache: eval { use blah::blah::blah::template_name_tmpl; $foo = blah::blah::blah::template_name_tmpl->getDocument(); }since TT apparently doesn't cover stuff in a file executed by require ... so forced it to look like it belonged to a module.