File Coverage

blib/lib/Test/Litmus/Log.pm
Criterion Covered Total %
statement 6 23 26.0
branch n/a
condition 0 2 0.0
subroutine 2 5 40.0
pod 0 3 0.0
total 8 33 24.2


line stmt bran cond sub pod time code
1             # The contents of this file are subject to the Mozilla Public License Version
2             # 1.1 (the "License"); you may not use this file except in compliance with
3             # the License. You may obtain a copy of the License at
4             # http://www.mozilla.org/MPL/
5             #
6             # Software distributed under the License is distributed on an "AS IS" basis,
7             # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
8             # for the specific language governing rights and limitations under the
9             # License.
10             #
11             # The Original Code is Test::Litmus.
12             #
13             # The Initial Developer of the Original Code is The Mozilla Corporation.
14             #
15             # Portions created by the Initial Developer are Copyright (C) 2006
16             # the Initial Developer. All Rights Reserved.
17             #
18             # Contributor(s): Zach Lipton
19              
20             package Test::Litmus::Log;
21              
22 1     1   13 use v5.6.1;
  1         4  
  1         49  
23 1     1   6 use strict;
  1         2  
  1         271  
24              
25             our $VERSION = '0.01';
26              
27             sub new {
28 0     0 0   my $class = shift;
29 0           my %args = @_;
30 0           my $self = {};
31 0           bless $self;
32            
33 0           $self->requiredField('type', %args);
34 0           $self->requiredField('data', %args);
35            
36 0           return $self;
37             }
38              
39             sub toXML {
40 0     0 0   my $self = shift;
41 0           my $x;
42            
43 0           $x = ''."\n";
44 0           $x .= ' {'data'}.']]>'."\n";
45 0           $x .= ''."\n";
46            
47 0           return $x;
48             }
49              
50             sub requiredField {
51 0     0 0   my $self = shift;
52 0           my $fieldname = shift;
53 0           my %args = @_;
54            
55 0   0       $self->{$fieldname} = $args{'-'.$fieldname} ||
56             die "You must specify a $fieldname";
57             }
58              
59             1;