Devel-Cover

 view release on metacpan or  search on metacpan

lib/Devel/Cover/DB.pm  view on Meta::CPAN

          unless (defined $type) {
            warn "Unknown type $t found parsing "
              . "uncoverable $criterion at $file:$.\n";
            $type = 999;  # partly magic number
          }
        }
      }
      # e.g.: count:1 | count:2,5 | count:1,4..7
      my $c = qr/\d+(?:\.\.\d+)?/;
      $count = $1 if $info =~ /count:($c(?:,$c)*)/;
      my @counts = map { m/^(\d+)\.\.(\d+)$/ ? ($1 .. $2) : $_ } split m/,/,
        $count;
      $class = $1 if $info =~ /class:(\w+)/;
      $note  = $1 if $info =~ /note:(.+)/;

      for my $c (@counts) {
        # no warnings "uninitialized";
        # warn "pushing $criterion, $c - 1, $type, $class, $note";
        push @waiting, [ $criterion, $c - 1, $type, $class, $note ];
      }

lib/Devel/Cover/Report/Html_minimal.pm  view on Meta::CPAN

sub escape_HTML {
  my $text = shift;
  chomp $text;

  $text = encode_entities($text);

  # Do not allow FF in text
  $text =~ tr/\x0c//d;

  # IE doesn't honor "white-space: pre" CSS
  my @text = split m/\n/ => $text;
  for (@text) {
    # Expand all tabs to spaces
    1 while s/\t+/' ' x (length($&) * 8 - length($`) % 8)/e;
    # make multiple spaces be multiple spaces
    s/(  +)/' ' x length $1/ge;
  }

  return join "\n" => @text;
}



( run in 2.367 seconds using v1.01-cache-2.11-cpan-71847e10f99 )