| 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 => 2; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 1 | open my $fileH, "<t/testfile"; | |||||||||
| 8 | |||||||||||
| 9 | 1 | my $tac = 1; | |||||||||
| 10 | 1 | my $caseInsensitive = 1; | |||||||||
| 11 | 1 | my $nth = 1; | |||||||||
| 12 | 1 | my @filter=(1,3,4); | |||||||||
| 13 | 1 | my $delim = "\\s+"; | |||||||||
| 14 | 1 | my $headerLines = 0; | |||||||||
| 15 | 1 | my $algo = Search::Fzf::AlgoCpp->newAlgoCpp($tac, $caseInsensitive, $headerLines, $nth, $delim, \@filter); | |||||||||
| 16 | 1 | $algo->asynRead($fileH); | |||||||||
| 17 | 1 | while(1) { | |||||||||
| 18 | 1 | ▶ | last if $algo->getReaderStatus() == 1; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 19 | } | ||||||||||
| 20 | 1 | close $fileH; | |||||||||
| 21 | |||||||||||
| 22 | 1 | my $iPattern = "9"; | |||||||||
| 23 | 1 | my $isSort = 1; | |||||||||
| 24 | 1 | my $threadNum = 4; | |||||||||
| 25 | 1 | my $algoType = 1; # 0---Exact 1---V1 2---V2 | |||||||||
| 26 | #first match | ||||||||||
| 27 | 1 | my $ret = $algo->matchList($iPattern, $isSort, $caseInsensitive, $algoType, $threadNum); | |||||||||
| 28 | 1 | my $matchNum = scalar @{$ret}; | |||||||||
| 29 | |||||||||||
| 30 | 1 | ▶ | ok($matchNum == 3, "test of algo V2.") || print "Bail out!\n"; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 31 | |||||||||||
| 32 | 1 | $iPattern = "99"; | |||||||||
| 33 | 1 | $ret = $algo->matchList($iPattern, $isSort, $caseInsensitive, $algoType, $threadNum); | |||||||||
| 34 | |||||||||||
| 35 | 1 | $matchNum = scalar @{$ret}; | |||||||||
| 36 | 1 | ▶ | ok($matchNum == 2, "continue test of algo V2.") || print "Bail out!\n"; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 37 | |||||||||||