| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
5
|
|
|
5
|
|
301527
|
use v5.20.0; |
|
|
5
|
|
|
|
|
16
|
|
|
2
|
|
|
|
|
|
|
package JMAP::Tester::SentenceBroker 0.109; |
|
3
|
|
|
|
|
|
|
|
|
4
|
5
|
|
|
5
|
|
429
|
use Moo; |
|
|
5
|
|
|
|
|
10726
|
|
|
|
5
|
|
|
|
|
40
|
|
|
5
|
|
|
|
|
|
|
with 'JMAP::Tester::Role::SentenceBroker'; |
|
6
|
|
|
|
|
|
|
|
|
7
|
5
|
|
|
5
|
|
4204
|
use experimental 'signatures'; |
|
|
5
|
|
|
|
|
1867
|
|
|
|
5
|
|
|
|
|
87
|
|
|
8
|
|
|
|
|
|
|
|
|
9
|
5
|
|
|
5
|
|
1371
|
use Data::OptList (); |
|
|
5
|
|
|
|
|
11138
|
|
|
|
5
|
|
|
|
|
199
|
|
|
10
|
5
|
|
|
5
|
|
570
|
use JMAP::Tester::Abort; |
|
|
5
|
|
|
|
|
12
|
|
|
|
5
|
|
|
|
|
57
|
|
|
11
|
5
|
|
|
5
|
|
1863
|
use JMAP::Tester::Response::Sentence; |
|
|
5
|
|
|
|
|
12
|
|
|
|
5
|
|
|
|
|
168
|
|
|
12
|
5
|
|
|
5
|
|
810
|
use JMAP::Tester::Response::Paragraph; |
|
|
5
|
|
|
|
|
36
|
|
|
|
5
|
|
|
|
|
4307
|
|
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
has response => ( |
|
15
|
|
|
|
|
|
|
is => 'ro', |
|
16
|
|
|
|
|
|
|
weak_ref => 1, |
|
17
|
|
|
|
|
|
|
required => 1, |
|
18
|
|
|
|
|
|
|
); |
|
19
|
|
|
|
|
|
|
|
|
20
|
19
|
|
|
19
|
0
|
3372
|
sub client_ids_for_items ($self, $items_ref) { |
|
|
19
|
|
|
|
|
36
|
|
|
|
19
|
|
|
|
|
29
|
|
|
|
19
|
|
|
|
|
34
|
|
|
21
|
19
|
|
|
|
|
42
|
map {; $_->[2] } @$items_ref; |
|
|
30
|
|
|
|
|
110
|
|
|
22
|
|
|
|
|
|
|
} |
|
23
|
|
|
|
|
|
|
|
|
24
|
139
|
|
|
139
|
0
|
1130
|
sub sentence_for_item ($self, $item) { |
|
|
139
|
|
|
|
|
264
|
|
|
|
139
|
|
|
|
|
198
|
|
|
|
139
|
|
|
|
|
234
|
|
|
25
|
139
|
|
|
|
|
3478
|
return JMAP::Tester::Response::Sentence->new({ |
|
26
|
|
|
|
|
|
|
name => $item->[0], |
|
27
|
|
|
|
|
|
|
arguments => $item->[1], |
|
28
|
|
|
|
|
|
|
client_id => $item->[2], |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sentence_broker => $self, |
|
31
|
|
|
|
|
|
|
}); |
|
32
|
|
|
|
|
|
|
} |
|
33
|
|
|
|
|
|
|
|
|
34
|
21
|
|
|
21
|
0
|
246
|
sub paragraph_for_items ($self, $items_ref) { |
|
|
21
|
|
|
|
|
38
|
|
|
|
21
|
|
|
|
|
33
|
|
|
|
21
|
|
|
|
|
35
|
|
|
35
|
|
|
|
|
|
|
return JMAP::Tester::Response::Paragraph->new({ |
|
36
|
21
|
|
|
|
|
58
|
sentences => [ map {; $self->sentence_for_item($_) } @$items_ref ], |
|
|
35
|
|
|
|
|
524
|
|
|
37
|
|
|
|
|
|
|
}); |
|
38
|
|
|
|
|
|
|
} |
|
39
|
|
|
|
|
|
|
|
|
40
|
12
|
|
|
12
|
0
|
152
|
sub abort ($self, $string, $diag_spec = undef) { |
|
|
12
|
|
|
|
|
28
|
|
|
|
12
|
|
|
|
|
27
|
|
|
|
12
|
|
|
|
|
25
|
|
|
|
12
|
|
|
|
|
21
|
|
|
41
|
12
|
|
100
|
11
|
|
130
|
$diag_spec //= [ 'Response sentences', sub { [ $_[0]->sentences ] } ]; |
|
|
11
|
|
|
|
|
53
|
|
|
42
|
|
|
|
|
|
|
|
|
43
|
12
|
|
|
|
|
30
|
my @diagnostics; |
|
44
|
|
|
|
|
|
|
|
|
45
|
12
|
50
|
|
|
|
40
|
if ($diag_spec) { |
|
46
|
12
|
|
|
|
|
69
|
my $todo = Data::OptList::mkopt($diag_spec); |
|
47
|
|
|
|
|
|
|
|
|
48
|
12
|
|
|
|
|
606
|
PAIR: for my $pair (@$todo) { |
|
49
|
13
|
|
|
|
|
38
|
my ($label, $value) = @$pair; |
|
50
|
|
|
|
|
|
|
|
|
51
|
13
|
100
|
|
|
|
46
|
if (not defined $value) { |
|
52
|
2
|
|
|
|
|
5
|
push @diagnostics, "$label\n"; |
|
53
|
2
|
|
|
|
|
8
|
next PAIR; |
|
54
|
|
|
|
|
|
|
} |
|
55
|
|
|
|
|
|
|
|
|
56
|
11
|
50
|
|
|
|
43
|
if (ref $value) { |
|
57
|
11
|
50
|
|
|
|
40
|
if (ref $value eq 'CODE') { |
|
58
|
11
|
|
|
|
|
43
|
$value = $value->($self->response); |
|
59
|
|
|
|
|
|
|
} |
|
60
|
|
|
|
|
|
|
|
|
61
|
11
|
|
|
|
|
61
|
$value = $self->response->dump_diagnostic($value); |
|
62
|
|
|
|
|
|
|
} |
|
63
|
|
|
|
|
|
|
|
|
64
|
11
|
|
|
|
|
278
|
push @diagnostics, "$label: $value"; |
|
65
|
11
|
50
|
|
|
|
101
|
$diagnostics[-1] .= "\n" unless $value =~ /\n\z/; |
|
66
|
|
|
|
|
|
|
} |
|
67
|
|
|
|
|
|
|
} |
|
68
|
|
|
|
|
|
|
|
|
69
|
12
|
50
|
|
|
|
415
|
die JMAP::Tester::Abort->new({ |
|
70
|
|
|
|
|
|
|
message => $string, |
|
71
|
|
|
|
|
|
|
(@diagnostics ? (diagnostics => \@diagnostics) : ()), |
|
72
|
|
|
|
|
|
|
}); |
|
73
|
|
|
|
|
|
|
} |
|
74
|
|
|
|
|
|
|
|
|
75
|
10
|
|
|
10
|
0
|
48
|
sub strip_json_types ($self, $struct) { |
|
|
10
|
|
|
|
|
18
|
|
|
|
10
|
|
|
|
|
19
|
|
|
|
10
|
|
|
|
|
19
|
|
|
76
|
10
|
|
|
|
|
27
|
state $typist = JSON::Typist->new; |
|
77
|
10
|
|
|
|
|
49
|
$typist->strip_types($struct); |
|
78
|
|
|
|
|
|
|
} |
|
79
|
|
|
|
|
|
|
|
|
80
|
5
|
|
|
5
|
|
43
|
no Moo; |
|
|
5
|
|
|
|
|
9
|
|
|
|
5
|
|
|
|
|
28
|
|
|
81
|
|
|
|
|
|
|
1; |
|
82
|
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
__END__ |