line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
2837
|
use 5.008; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
36
|
|
2
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
30
|
|
3
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
60
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Data::Conveyor::Service::Result::Tabular_TEST; |
6
|
|
|
|
|
|
|
BEGIN { |
7
|
1
|
|
|
1
|
|
16
|
$Data::Conveyor::Service::Result::Tabular_TEST::VERSION = '1.103130'; |
8
|
|
|
|
|
|
|
} |
9
|
|
|
|
|
|
|
# ABSTRACT: Stage-based conveyor-belt-like ticket handling system |
10
|
|
|
|
|
|
|
|
11
|
1
|
|
|
1
|
|
6
|
use Error::Hierarchy::Test 'throws2_ok'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
53
|
|
12
|
1
|
|
|
1
|
|
5
|
use Test::More; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
9
|
|
13
|
1
|
|
|
1
|
|
293
|
use parent 'Data::Conveyor::Test'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
9
|
|
14
|
1
|
|
|
1
|
|
93
|
use constant PLAN => 5; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
461
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub run { |
17
|
1
|
|
|
1
|
1
|
2959
|
my $self = shift; |
18
|
1
|
|
|
|
|
10
|
$self->SUPER::run(@_); |
19
|
1
|
|
|
|
|
605
|
$self->test_list_of_hashes_input; |
20
|
1
|
|
|
|
|
1201
|
$self->test_list_of_objects_input_ok; |
21
|
1
|
|
|
|
|
1280
|
$self->test_list_of_objects_input_no_baz; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub test_list_of_hashes_input { |
25
|
1
|
|
|
1
|
1
|
2
|
my $self = shift; |
26
|
1
|
|
|
|
|
27
|
my $o = $self->make_real_object; |
27
|
1
|
|
|
|
|
3116
|
my $rows = [ |
28
|
|
|
|
|
|
|
{ foo => 'row0foo', bar => 'row0bar', baz => 'row0baz' }, |
29
|
|
|
|
|
|
|
{ foo => 'row1foo', bar => 'row1bar', baz => 'row1baz' }, |
30
|
|
|
|
|
|
|
{ foo => 'row2foo', bar => 'row2bar', baz => 'row2baz' }, |
31
|
|
|
|
|
|
|
]; |
32
|
1
|
|
|
|
|
11
|
$o->set_from_rows( |
33
|
|
|
|
|
|
|
fields => [qw/foo bar baz/], |
34
|
|
|
|
|
|
|
rows => $rows, |
35
|
|
|
|
|
|
|
); |
36
|
1
|
|
|
|
|
6
|
is_deeply( |
37
|
|
|
|
|
|
|
scalar $o->rows, |
38
|
|
|
|
|
|
|
[ [qw/row0foo row0bar row0baz/], [qw/row1foo row1bar row1baz/], |
39
|
|
|
|
|
|
|
[qw/row2foo row2bar row2baz/], |
40
|
|
|
|
|
|
|
], |
41
|
|
|
|
|
|
|
'list of hashes input: rows()' |
42
|
|
|
|
|
|
|
); |
43
|
1
|
|
|
|
|
1519
|
is_deeply(scalar $o->result_as_list_of_hashes, |
44
|
|
|
|
|
|
|
$rows, 'list of hashes input: result_as_list_of_hashes()'); |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub test_list_of_objects_input_ok { |
48
|
1
|
|
|
1
|
1
|
3
|
my $self = shift; |
49
|
1
|
|
|
|
|
30
|
my $o = $self->make_real_object; |
50
|
1
|
|
|
|
|
170
|
my $rows = [ |
51
|
|
|
|
|
|
|
Data::Conveyor::Temp001->new(row => 0), |
52
|
|
|
|
|
|
|
Data::Conveyor::Temp001->new(row => 1), |
53
|
|
|
|
|
|
|
Data::Conveyor::Temp001->new(row => 2), |
54
|
|
|
|
|
|
|
]; |
55
|
1
|
|
|
|
|
219
|
$o->set_from_rows( |
56
|
|
|
|
|
|
|
fields => [qw/foo bar baz/], |
57
|
|
|
|
|
|
|
rows => $rows, |
58
|
|
|
|
|
|
|
); |
59
|
1
|
|
|
|
|
5
|
is_deeply( |
60
|
|
|
|
|
|
|
scalar $o->rows, |
61
|
|
|
|
|
|
|
[ [qw/row0foo row0bar row0baz/], [qw/row1foo row1bar row1baz/], |
62
|
|
|
|
|
|
|
[qw/row2foo row2bar row2baz/], |
63
|
|
|
|
|
|
|
], |
64
|
|
|
|
|
|
|
'list of objects input (ok): rows()' |
65
|
|
|
|
|
|
|
); |
66
|
1
|
|
|
|
|
1715
|
is_deeply( |
67
|
|
|
|
|
|
|
scalar $o->result_as_list_of_hashes, |
68
|
|
|
|
|
|
|
[ { foo => 'row0foo', bar => 'row0bar', baz => 'row0baz' }, |
69
|
|
|
|
|
|
|
{ foo => 'row1foo', bar => 'row1bar', baz => 'row1baz' }, |
70
|
|
|
|
|
|
|
{ foo => 'row2foo', bar => 'row2bar', baz => 'row2baz' }, |
71
|
|
|
|
|
|
|
], |
72
|
|
|
|
|
|
|
'list of objects input (ok): result_as_list_of_hashes()' |
73
|
|
|
|
|
|
|
); |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
sub test_list_of_objects_input_no_baz { |
77
|
1
|
|
|
1
|
1
|
4
|
my $self = shift; |
78
|
1
|
|
|
|
|
8
|
my $o = $self->make_real_object; |
79
|
1
|
|
|
|
|
126
|
my $rows = [ |
80
|
|
|
|
|
|
|
Data::Conveyor::Temp002->new(row => 0), |
81
|
|
|
|
|
|
|
Data::Conveyor::Temp002->new(row => 1), |
82
|
|
|
|
|
|
|
Data::Conveyor::Temp002->new(row => 2), |
83
|
|
|
|
|
|
|
]; |
84
|
|
|
|
|
|
|
throws2_ok { |
85
|
1
|
|
|
1
|
|
57
|
$o->set_from_rows( |
86
|
|
|
|
|
|
|
fields => [qw/foo bar baz/], |
87
|
|
|
|
|
|
|
rows => $rows, |
88
|
|
|
|
|
|
|
); |
89
|
|
|
|
|
|
|
} |
90
|
1
|
|
|
|
|
84
|
'Error::Hierarchy::Internal::CustomMessage', |
91
|
|
|
|
|
|
|
qr/can't set field \[baz\] from row \[Data::Conveyor::Temp002=HASH\(/, |
92
|
|
|
|
|
|
|
"set_from_rows() using objects that can't baz()"; |
93
|
|
|
|
|
|
|
} |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
package Data::Conveyor::Temp001; |
96
|
|
|
|
|
|
|
BEGIN { |
97
|
1
|
|
|
1
|
|
16
|
$Data::Conveyor::Temp001::VERSION = '1.103130'; |
98
|
|
|
|
|
|
|
} |
99
|
1
|
|
|
1
|
|
5
|
use parent 'Class::Accessor::Complex'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
4
|
|
100
|
|
|
|
|
|
|
__PACKAGE__->mk_new->mk_scalar_accessors(qw(row)); |
101
|
3
|
|
|
3
|
|
10
|
sub foo { sprintf 'row%dfoo', $_[0]->row } |
102
|
3
|
|
|
3
|
|
12
|
sub bar { sprintf 'row%dbar', $_[0]->row } |
103
|
3
|
|
|
3
|
|
10
|
sub baz { sprintf 'row%dbaz', $_[0]->row } |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
package Data::Conveyor::Temp002; |
106
|
|
|
|
|
|
|
BEGIN { |
107
|
1
|
|
|
1
|
|
142
|
$Data::Conveyor::Temp002::VERSION = '1.103130'; |
108
|
|
|
|
|
|
|
} |
109
|
1
|
|
|
1
|
|
4
|
use parent 'Class::Accessor::Complex'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
4
|
|
110
|
|
|
|
|
|
|
__PACKAGE__->mk_new->mk_scalar_accessors(qw(row)); |
111
|
1
|
|
|
1
|
|
6
|
sub foo { sprintf 'row%dfoo', $_[0]->row } |
112
|
1
|
|
|
1
|
|
5
|
sub bar { sprintf 'row%dbar', $_[0]->row } |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
# this class can't baz() |
115
|
|
|
|
|
|
|
1; |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
__END__ |