AlgoCpp/t/02-asynread.t

filter: Statementstmt 100% 44 / 44 Branchbran 62.5% 5 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod n/a totaltotal 94.7% 54 / 57 CC 1 SCAR 0.0
CC
1
Cov
94%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« AlgoCpp/t/04-nthread.t ↑ Summary AlgoCpp/t/03-headandmark.t »
1 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 1 ▶use Search::Fzf::AlgoCpp;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use Test::More tests => 4;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 open my $fileH, "<t/testfile";
8  
9 1 my $tac = 0;
10 1 my $caseInsensitive = 1;
11 1 my $headerLines = 0;
12 1 my $algo = Search::Fzf::AlgoCpp->new($tac, $caseInsensitive, $headerLines);
13 1 $algo->asynRead($fileH);
14 1 while(1) {
15 546 ▶ last if $algo->getReaderStatus() == 1;
Branch: 1 branch
BranchTrueFalseTotal
if $algo->getReaderStatus == 1 1 545 546
16 }
17 1 close $fileH;
18  
19 1 ▶ok($algo->getCatArraySize == 13, "simple read from array.") || print "Bail out!\n";
Branch: 1 branch
BranchTrueFalseTotal
&ok($algo->getCatArraySize == 13, "simple read from array.") or print "Bail out!\n" 1 0 1
20  
21 1 my $iPattern = "9";
22 1 my $isSort = 0;
23 1 my $threadNum = 0;
24 1 my $algoType = 2; # 0---Exact 1---V1 2---V2
25 #first match
26 1 my $ret = $algo->matchList($iPattern, $isSort, $caseInsensitive, $algoType, $threadNum);
27 1 my $matchNum = scalar @{$ret};
28  
29 1 ▶ok($matchNum == 4, "test of algo V2.") || print "Bail out!\n";
Branch: 1 branch
BranchTrueFalseTotal
&ok($matchNum == 4, "test of algo V2.") or print "Bail out!\n" 1 0 1
30  
31 1 $iPattern = "99";
32 1 $isSort = 0;
33 1 $threadNum = 4;
34 1 $ret = $algo->matchList($iPattern, $isSort, $caseInsensitive, $algoType, $threadNum);
35  
36 1 $matchNum = scalar @{$ret};
37 1 ▶ok($matchNum == 2, "continue test of algo V2.") || print "Bail out!\n";
Branch: 1 branch
BranchTrueFalseTotal
&ok($matchNum == 2, "continue test of algo V2.") or print "Bail out!\n" 1 0 1
38  
39 1 my $nullArr = $algo->getNullMatchList();
40 1 my $size = scalar @{$nullArr};
41 1 ok($size == 13, "test getNullMatchList.");
42  
« AlgoCpp/t/04-nthread.t ↑ Summary AlgoCpp/t/03-headandmark.t »