Utils.pm untested

filter: Statementstmt 0.0% 0 / 20 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 5 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 31 CC 3 SCAR 14.6
CC
3
Cov
0%
_shiftBoolean
6.0
_shiftVisitor
6.0
BEGIN
2.0
CRAP 4.3
1 use strict;
2 use warnings;
3  
4 package SVN::Friendly::Utils;
5 my $CLASS = __PACKAGE__;
6  
7 #--------------------------------------------------------------------
8  
9 use Exporter;
10 our @ISA = qw(Exporter);
11 our @EXPORT_OK=qw(_shiftBoolean _shiftVisitor);
12  
13 #--------------------------------------------------------------------
14  
15 our $NOOP = sub { return 0; };
16  
17  
18 #==================================================================
19 # FUNCTIONS - for use internally within SVN::Friendly
20 #==================================================================
21  
22 #----------------------------------------------------------------
23  
24 sub _shiftBoolean {
25 my $xArg = shift @{shift @_};
26 return defined($xArg) ? $xArg : 0;
27 }
28  
29 #----------------------------------------------------------------
30  
31 sub _shiftVisitor {
32 my ($aArgs) = @_;
33  
34 #some of the subversion API methods cause a segmentation fault
35 #unless they are passed some sort of visitor, even if that
36 #visitor is only a NOOP
37  
38 my $crVisit = shift @$aArgs;
39 return defined($crVisit) ? $crVisit : $NOOP;
40 }
41  
42 #==================================================================
43 # MODULE INITIALIZATION
44 #==================================================================
45  
46 1;