blib/lib/HTML5/leaks.pl untested

filter: Statementstmt 0.0% 0 / 22 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 5 Podpod n/a totaltotal 0.0% 0 / 31 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 #!/usr/bin/perl
2 use warnings;
3 use strict;
4 use File::Slurp qw|read_file write_file|;
5 use File::Basename qw|dirname|;
6 use POSIX;
7  
8 for my $file (glob("t/*.t")) {
9 my $text = read_file($file);
10
11 if ($text =~ /<test-body>(.*?)<\/test-body>/sim) {
12 print $file."\n";
13 my $code =
14 '
15 use warnings;
16 use strict;
17 use Test::LeakTrace;
18 use HTML5::DOM;
19
20 sub ok {
21 print "ok - ".$_[1]."\n" if ($_[0]);
22 print "not ok - ".$_[1]."\n" if (!$_[0]);
23 };
24 sub done_testing { };
25 sub require_ok { };
26 sub can_ok { };
27 sub isa_ok { };
28
29 no_leaks_ok {
30 (sub {
31 '.$1.';
32 1;
33 })->();
34 };
35 ';
36 eval($code);
37 die "$@" if ($@);
38 }
39 }