File Coverage

blib/lib/App/RecordStream/Test/UniqConcatHelper.pm
Criterion Covered Total %
statement 17 17 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod 0 1 0.0
total 21 22 95.4


line stmt bran cond sub pod time code
1             package App::RecordStream::Test::UniqConcatHelper;
2              
3 2     2   2891 use strict;
  2         4  
  2         57  
4 2     2   9 use warnings;
  2         5  
  2         51  
5              
6 2     2   10 use App::RecordStream::Record;
  2         5  
  2         197  
7              
8             sub test_aggregator
9             {
10 4     4 0 57 my $aggr = shift;
11 4         12 my $delim = shift;
12 4         10 my $field = shift;
13              
14 4         16 my $cookie = $aggr->initial();
15              
16 4         13 foreach my $n (1, 3, 3, 1, 2, 7)
17             {
18 24         113 $cookie = $aggr->combine($cookie, App::RecordStream::Record->new("x" => $n));
19             }
20              
21 4         23 my $value = $aggr->squish($cookie);
22              
23 4         26 Test::More::is($value, '1,2,3,7', "uniq concat of 1, 3, 3, 1, 2, 7");
24             }
25              
26             1;