File Coverage

blib/lib/App/diff2vba/Util.pm
Criterion Covered Total %
statement 8 16 50.0
branch 0 2 0.0
condition n/a
subroutine 3 4 75.0
pod 0 1 0.0
total 11 23 47.8


line stmt bran cond sub pod time code
1             package App::diff2vba;
2 1     1   16 use v5.14;
  1         4  
3 1     1   7 use warnings;
  1         2  
  1         63  
4              
5 1     1   6 use Exporter qw(import);
  1         2  
  1         243  
6             our @EXPORT = qw(split_string);
7              
8             sub split_string {
9 0     0 0   local $_ = shift;
10 0           my $count = shift;
11 0           my $len = int((length($_) + $count - 1) / $count);
12 0           my @split;
13 0           while (length) {
14 0           push @split, substr($_, 0, $len, '');
15             }
16 0 0         @split == $count or die;
17 0           @split;
18             }
19              
20             1;