File Coverage

blib/lib/App/ansiecho/Util.pm
Criterion Covered Total %
statement 12 12 100.0
branch 2 4 50.0
condition n/a
subroutine 5 5 100.0
pod 0 2 0.0
total 19 23 82.6


line stmt bran cond sub pod time code
1             package App::ansiecho;
2 2     2   25 use v5.14;
  2         8  
3 2     2   10 use warnings;
  2         4  
  2         60  
4              
5 2     2   10 use charnames ':full';
  2         8  
  2         15  
6              
7             sub decode_argv {
8             map {
9 75 50   75 0 158 utf8::is_utf8($_) ? $_ : decode('utf8', $_);
  317         8190  
10             }
11             @_;
12             }
13              
14             sub safe_backslash {
15 207     207 0 788 $_[0] =~ s{
16             ( \\ x\{[0-9a-f]+\}
17             | \\ x[0-9a-f]{2}
18             | \\ N\{[\ \w]+\}
19             | \\ N\{U\+[0-9a-f]+\}
20             | \\ c.
21             | \\ o\{\d+\}
22             | \\ \d{1,3}
23             | \\ .
24             )
25 10 50       723 }{ eval qq["$1"] or die "$1 : string error.\n"}xiger;
26             }
27              
28             1;