Harness/Compatible/Iterator.pm

filter: Statementstmt 73.3% 11 / 15 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 60.0% 3 / 5 Podpod 100% 2 / 2 totaltotal 66.6% 16 / 24 CC 2 SCAR 10.4
CC
2
Cov
65%
next
6.0
new
2.0
BEGIN
1.0
CRAP 2.8
« Parser/Source.pm ↑ Summary Parser/Iterator.pm »
1 package TAPx::Harness::Compatible::Iterator;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use vars qw($VERSION);
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use TAPx::Parser::Iterator;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 $VERSION = '0.50_07';
8  
9 =head1 NAME
10  
11 TAPx::Harness::Compatible::Iterator - Internal TAPx::Harness::Compatible Iterator
12  
13 =head1 SYNOPSIS
14  
15 use TAPx::Harness::Compatible::Iterator;
16 my $it = TAPx::Harness::Compatible::Iterator->new(\*TEST);
17 my $it = TAPx::Harness::Compatible::Iterator->new(\@array);
18  
19 my $line = $it->next;
20  
21 =head1 DESCRIPTION
22  
23 B<FOR INTERNAL USE ONLY!>
24  
25 This is a simple iterator wrapper for arrays and filehandles.
26  
27 =head2 new()
28  
29 Create an iterator.
30  
31 =head2 next()
32  
33 Iterate through it, of course.
34  
35 =cut
36  
37 0 ▶sub new {
Subroutine new: not called CC=1 SCAR=6.9
Pod documented
38 0 my ( $class, $thing ) = @_;
39  
40 0 return bless { iter => TAPx::Parser::Iterator->new($thing) }, $class;
41 }
42  
43 0 ▶sub next {
Subroutine next: not called CC=2 SCAR=17.9
Pod documented
44 0 my $next = shift->{iter}->next_raw;
45 0 ▶ return defined $next ? "$next\n" : $next;
Branch: 1 branch
BranchTrueFalseTotal
defined $next ? : 0 0 0
46 }
47  
48 1 1;
« Parser/Source.pm ↑ Summary Parser/Iterator.pm »