Properties.pm untested

filter: Statementstmt 0.0% 0 / 20 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 7 Podpod 0.0% 0 / 4 totaltotal 0.0% 0 / 35 CC 3 SCAR 16.7
CC
3
Cov
0%
output
12.0
vertical
2.0
tabular
2.0
CRAP 5.3
1 package Sash::Properties;
2 use strict;
3 use warnings;
4  
5 use Carp;
6  
7 # Default the output type.
8 my $_output = 'tabular';
9  
10 # Allow the user to define the output type.
11 sub output {
12 my $class = shift;
13 my $output = shift;
14
15 my $allowed_output_formats = 'perlval|tabular|vertical';
16  
17 if ( defined $output ) {
18 croak "Invalid output <$output> format. Allowed output formats are $allowed_output_formats"
19 unless $output =~ /$allowed_output_formats/i;
20
21 $_output = lc( $output );
22 }
23
24 return $_output;
25 }
26  
27 # The following emulate constants so we can control the internal structure of
28 # the comparisons.
29  
30 sub vertical {
31 return 'vertical';
32 }
33  
34 sub tabular {
35 return 'tabular';
36 }
37  
38 sub perlval {
39 return 'perlval';
40 }
41  
42 1;