File Coverage

blib/lib/App/chot/Util.pm
Criterion Covered Total %
statement 5 10 50.0
branch 0 4 0.0
condition 0 2 0.0
subroutine 2 3 66.6
pod 0 1 0.0
total 7 20 35.0


line stmt bran cond sub pod time code
1             package App::chot;
2 1     1   10 use v5.14;
  1         3  
3 1     1   3 use warnings;
  1         1  
  1         174  
4              
5             sub is_binary {
6 0   0 0 0   my $file = shift // die;
7 0 0         open my $fh, '<', $file or die "$file: $!\n";
8 0           binmode $fh, ':raw';
9 0           $fh->read(local $_, 512);
10 0 0         /[\0\377]/ || (tr/\000-\007\013\016-\032\034-\037/./ * 10 > length);
11             }
12              
13             1;