| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Test::Run::Obj::FailedObj; |
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=head1 NAME |
|
4
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
Test::Run::Obj::FailedObj - an object representing a failure. |
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
Inherits from Test::Run::Base::Struct. |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 METHODS |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=cut |
|
14
|
|
|
|
|
|
|
|
|
15
|
4
|
|
|
4
|
|
28
|
use strict; |
|
|
4
|
|
|
|
|
9
|
|
|
|
4
|
|
|
|
|
145
|
|
|
16
|
4
|
|
|
4
|
|
22
|
use warnings; |
|
|
4
|
|
|
|
|
15
|
|
|
|
4
|
|
|
|
|
204
|
|
|
17
|
|
|
|
|
|
|
|
|
18
|
4
|
|
|
4
|
|
29
|
use vars qw(@fields); |
|
|
4
|
|
|
|
|
11
|
|
|
|
4
|
|
|
|
|
242
|
|
|
19
|
|
|
|
|
|
|
|
|
20
|
4
|
|
|
4
|
|
26
|
use Moose; |
|
|
4
|
|
|
|
|
8
|
|
|
|
4
|
|
|
|
|
39
|
|
|
21
|
|
|
|
|
|
|
|
|
22
|
4
|
|
|
4
|
|
27496
|
use Test::Run::Obj::IntOrUnknown; |
|
|
4
|
|
|
|
|
11
|
|
|
|
4
|
|
|
|
|
43
|
|
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
extends('Test::Run::Base::Struct'); |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
has 'canon' => (is => "rw", isa => "Str"); |
|
27
|
|
|
|
|
|
|
has 'canon_strings' => (is => "rw", isa => "ArrayRef"); |
|
28
|
|
|
|
|
|
|
has 'estat' => (is => "rw", isa => "Str"); |
|
29
|
|
|
|
|
|
|
has 'failed' => (is => 'rw', isa => 'Test::Run::Obj::IntOrUnknown', |
|
30
|
|
|
|
|
|
|
handles => |
|
31
|
|
|
|
|
|
|
{ |
|
32
|
|
|
|
|
|
|
'failed_str' => 'get_string_val', |
|
33
|
|
|
|
|
|
|
}, |
|
34
|
|
|
|
|
|
|
); |
|
35
|
|
|
|
|
|
|
has 'max' => (is => 'rw', isa => 'Test::Run::Obj::IntOrUnknown', |
|
36
|
|
|
|
|
|
|
handles => |
|
37
|
|
|
|
|
|
|
{ |
|
38
|
|
|
|
|
|
|
'max_str' => 'get_string_val', |
|
39
|
|
|
|
|
|
|
}, |
|
40
|
|
|
|
|
|
|
); |
|
41
|
|
|
|
|
|
|
has 'list_len' => (is => "rw", isa => "Num"); |
|
42
|
|
|
|
|
|
|
has 'name' => (is => "rw", isa => "Str"); |
|
43
|
|
|
|
|
|
|
has 'percent' => (is => "rw", isa => "Maybe[Str]"); |
|
44
|
|
|
|
|
|
|
has 'wstat' => (is => "rw", isa => "Str"); |
|
45
|
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head2 $self->_defined_percent() |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
Returns a defined percentage. It returns the percentage or 0 if it is |
|
49
|
|
|
|
|
|
|
undefined. |
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=cut |
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub _defined_percent |
|
54
|
|
|
|
|
|
|
{ |
|
55
|
7
|
|
|
7
|
|
24
|
my $self = shift; |
|
56
|
|
|
|
|
|
|
|
|
57
|
7
|
100
|
|
|
|
240
|
return defined($self->percent()) ? $self->percent() : 0; |
|
58
|
|
|
|
|
|
|
} |
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub _do_canon_concat |
|
61
|
|
|
|
|
|
|
{ |
|
62
|
4
|
|
|
4
|
|
16
|
my ($self, $ret, $canon) = @_; |
|
63
|
|
|
|
|
|
|
|
|
64
|
4
|
|
|
|
|
18
|
my $first = shift(@$canon); |
|
65
|
|
|
|
|
|
|
|
|
66
|
4
|
|
|
|
|
17
|
my $new_last_ret = "$ret->[-1] $first"; |
|
67
|
|
|
|
|
|
|
|
|
68
|
4
|
50
|
|
|
|
122
|
if (length($new_last_ret) < $self->list_len()) |
|
69
|
|
|
|
|
|
|
{ |
|
70
|
4
|
|
|
|
|
55
|
$ret->[-1] = $new_last_ret; |
|
71
|
|
|
|
|
|
|
} |
|
72
|
|
|
|
|
|
|
else |
|
73
|
|
|
|
|
|
|
{ |
|
74
|
0
|
|
|
|
|
0
|
push @$ret, $first; |
|
75
|
|
|
|
|
|
|
} |
|
76
|
|
|
|
|
|
|
} |
|
77
|
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
sub _calc_stringification |
|
79
|
|
|
|
|
|
|
{ |
|
80
|
7
|
|
|
7
|
|
34
|
my ($self, $canon) = @_; |
|
81
|
|
|
|
|
|
|
|
|
82
|
7
|
|
|
|
|
26
|
my @ret = shift(@$canon); |
|
83
|
|
|
|
|
|
|
|
|
84
|
7
|
|
|
|
|
23
|
while (@$canon) |
|
85
|
|
|
|
|
|
|
{ |
|
86
|
4
|
|
|
|
|
95
|
$self->_do_canon_concat(\@ret, $canon); |
|
87
|
|
|
|
|
|
|
} |
|
88
|
|
|
|
|
|
|
|
|
89
|
7
|
|
|
|
|
279
|
return \@ret; |
|
90
|
|
|
|
|
|
|
} |
|
91
|
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
sub _assign_canon_strings |
|
93
|
|
|
|
|
|
|
{ |
|
94
|
7
|
|
|
7
|
|
20
|
my $self = shift; |
|
95
|
|
|
|
|
|
|
|
|
96
|
7
|
|
|
|
|
17
|
my $args = shift; |
|
97
|
|
|
|
|
|
|
|
|
98
|
7
|
|
|
|
|
178
|
$self->list_len($args->{main}->list_len()); |
|
99
|
|
|
|
|
|
|
|
|
100
|
7
|
|
|
|
|
223
|
$self->canon_strings( |
|
101
|
|
|
|
|
|
|
$self->_calc_stringification( |
|
102
|
|
|
|
|
|
|
[ split /\s+/, $self->canon() ], |
|
103
|
|
|
|
|
|
|
) |
|
104
|
|
|
|
|
|
|
); |
|
105
|
|
|
|
|
|
|
} |
|
106
|
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=head2 $self->first_canon_string() |
|
108
|
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
The first of the canon_strings(). (With index 0). |
|
110
|
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=cut |
|
112
|
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
sub first_canon_string |
|
114
|
|
|
|
|
|
|
{ |
|
115
|
7
|
|
|
7
|
1
|
17
|
my $self = shift; |
|
116
|
|
|
|
|
|
|
|
|
117
|
7
|
|
|
|
|
223
|
return $self->canon_strings()->[0]; |
|
118
|
|
|
|
|
|
|
} |
|
119
|
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
=head2 $self->rest_of_canons() |
|
121
|
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
An array reference containing all the canons except the 0th. |
|
123
|
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
=cut |
|
125
|
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
sub rest_of_canons |
|
127
|
|
|
|
|
|
|
{ |
|
128
|
7
|
|
|
7
|
1
|
14
|
my $self = shift; |
|
129
|
|
|
|
|
|
|
|
|
130
|
7
|
|
|
|
|
180
|
my $canons = $self->canon_strings(); |
|
131
|
|
|
|
|
|
|
|
|
132
|
7
|
|
|
|
|
26
|
return [ @{$canons}[ 1 .. ($#$canons-1) ] ]; |
|
|
7
|
|
|
|
|
94
|
|
|
133
|
|
|
|
|
|
|
} |
|
134
|
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
=head2 $self->max_str() |
|
136
|
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
A string representation of max. |
|
138
|
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
=head2 $self->failed_str() |
|
140
|
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
A string representation of failed. |
|
142
|
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
=cut |
|
144
|
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
1; |
|
146
|
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
__END__ |
|
148
|
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
=head1 SEE ALSO |
|
150
|
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
L<Test::Run::Base::Struct>, L<Test::Run::Obj>, L<Test::Run::Core> |
|
152
|
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
=head1 LICENSE |
|
154
|
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
This file is freely distributable under the MIT X11 license. |
|
156
|
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
L<http://www.opensource.org/licenses/mit-license.php> |
|
158
|
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
=head1 AUTHOR |
|
160
|
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
Shlomi Fish, L<http://www.shlomifish.org/>. |
|
162
|
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
=cut |
|
164
|
|
|
|
|
|
|
|