blib/lib/App/RecordStream/Test/Tester.pm

filter: Statementstmt 100% 32 / 32 Branchbran 50.0% 2 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 0.0% 0 / 4 totaltotal 87.2% 41 / 47 CC 3 SCAR 5.2
CC
3
Cov
94%
test_stdin
3.1
BEGIN
1.0
BEGIN
1.0
CRAP 1.7
« blib/lib/App/RecordStream/Aggregator/Minimum.pm ↑ Summary blib/lib/App/RecordStream/Clumper/KeyPerfect.pm »
1 package App::RecordStream::Test::Tester;
2  
3 8 our $VERSION = "4.0.23";
4  
5 8 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 8 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 8 ▶use App::RecordStream::Test::OperationHelper;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 sub new {
11 7 ▶ my $class = shift;
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
12 7 my $operation = shift;
13  
14 7 my $this = {
15 OPERATION => $operation,
16 };
17  
18 7 bless $this, $class;
19 7 return $this;
20 }
21  
22 sub no_input_test {
23 3 ▶ my $this = shift;
Subroutine no_input_test: called CC=1 SCAR=0.0
Pod undocumented
24 3 my $args = shift;
25 3 my $output = shift;
26  
27 return App::RecordStream::Test::OperationHelper->do_match(
28 3 $this->{'OPERATION'},
29 $args,
30 undef,
31 $output,
32 );
33 }
34  
35 sub test_input {
36 16 ▶ my $this = shift;
Subroutine test_input: called CC=1 SCAR=0.0
Pod undocumented
37 16 my $args = shift;
38 16 my $input = shift;
39 16 my $output = shift;
40  
41 return App::RecordStream::Test::OperationHelper->do_match(
42 16 $this->{'OPERATION'},
43 $args,
44 ['LINES', split(/\n/, $input)],
45 $output,
46 );
47 }
48  
49 sub test_stdin {
50 14 ▶ my $this = shift;
Subroutine test_stdin: called CC=3 SCAR=11.2
Pod undocumented
51 14 my $args = shift;
52 14 my $input = shift;
53 14 my $output = shift;
54  
55 # Re-open stdin to the given input
56 14 ▶ close(STDIN) or die "Cannot close STDIN: $!";
Branch: 1 branch
BranchTrueFalseTotal
close STDIN or die "Cannot close STDIN: $!" 0 14 14
57 14 ▶ open(STDIN, "<", \$input) or die "Cannot re-open STDIN to string ref: $!";
Branch: 1 branch
BranchTrueFalseTotal
open STDIN, "<", \$input or die "Cannot re-open STDIN to string ref: $!" 0 14 14
58  
59 return App::RecordStream::Test::OperationHelper->do_match(
60 14 $this->{'OPERATION'},
61 $args,
62 undef,
63 $output,
64 );
65 }
66  
67 8 1;
« blib/lib/App/RecordStream/Aggregator/Minimum.pm ↑ Summary blib/lib/App/RecordStream/Clumper/KeyPerfect.pm »