Branch Coverage

blib/lib/PAGI/Server/EventValidator.pm
Criterion Covered Total %
branch 59 116 50.8


line true false branch
28 7 10 if ($type eq 'http.response.start') { }
7 3 elsif ($type eq 'http.response.body') { }
3 0 elsif ($type eq 'http.response.trailers') { }
45 1 6 unless exists $event->{'status'}
47 2 4 unless defined $event->{'status'} and $event->{'status'} =~ /^\d+$/
50 3 1 if (exists $event->{'headers'} and defined $event->{'headers'})
52 1 2 unless ref $event->{'headers'} eq "ARRAY"
65 2 5 unless $count <= 1
69 1 4 if (exists $event->{'offset'} and defined $event->{'offset'})
71 1 0 unless $event->{'offset'} =~ /^\d+$/
75 1 3 if (exists $event->{'length'} and defined $event->{'length'})
77 1 0 unless $event->{'length'} =~ /^\d+$/
85 2 1 if (exists $event->{'headers'} and defined $event->{'headers'})
87 1 1 unless ref $event->{'headers'} eq "ARRAY"
99 0 11 if ($type eq 'websocket.accept') { }
4 7 elsif ($type eq 'websocket.send') { }
3 4 elsif ($type eq 'websocket.close') { }
4 0 elsif ($type eq 'websocket.keepalive') { }
0 0 elsif ($type eq 'websocket.http.response.start') { }
0 0 elsif ($type eq 'websocket.http.response.body') { }
123 0 0 if (exists $event->{'headers'} and defined $event->{'headers'})
125 0 0 unless ref $event->{'headers'} eq "ARRAY"
137 2 2 unless $count == 1
145 2 1 if (exists $event->{'code'} and defined $event->{'code'})
147 1 1 unless $event->{'code'} =~ /^\d+$/
156 1 3 unless exists $event->{'interval'}
158 1 2 unless defined $event->{'interval'} and $event->{'interval'} =~ /^[\d.]+$/
166 0 0 unless exists $event->{'status'}
168 0 0 unless defined $event->{'status'} and $event->{'status'} =~ /^\d+$/
171 0 0 if (exists $event->{'headers'} and defined $event->{'headers'})
173 0 0 unless ref $event->{'headers'} eq "ARRAY"
181 0 0 if (exists $event->{'more'} and defined $event->{'more'})
183 0 0 unless $event->{'more'} =~ /^\d+$/
195 0 10 if ($type eq 'sse.start') { }
4 6 elsif ($type eq 'sse.send') { }
3 3 elsif ($type eq 'sse.comment') { }
3 0 elsif ($type eq 'sse.keepalive') { }
0 0 elsif ($type eq 'sse.close') { }
0 0 elsif ($type eq 'sse.http.response.start') { }
0 0 elsif ($type eq 'sse.http.response.body') { }
223 0 0 unless exists $event->{'status'} and defined $event->{'status'}
225 0 0 unless $event->{'status'} =~ /^\d+$/
226 0 0 if (exists $event->{'headers'} and defined $event->{'headers'})
228 0 0 unless ref $event->{'headers'} eq "ARRAY"
235 0 0 if (exists $event->{'more'} and defined $event->{'more'})
237 0 0 unless $event->{'more'} =~ /^\d+$/
245 0 0 if (exists $event->{'reason'} and defined $event->{'reason'})
247 0 0 if ref $event->{'reason'}
255 0 0 if (exists $event->{'status'} and defined $event->{'status'})
257 0 0 unless $event->{'status'} =~ /^\d+$/
261 0 0 if (exists $event->{'headers'} and defined $event->{'headers'})
263 0 0 unless ref $event->{'headers'} eq "ARRAY"
272 1 3 unless exists $event->{'data'}
274 1 2 unless defined $event->{'data'} and not ref $event->{'data'}
282 1 2 unless exists $event->{'comment'}
284 1 1 unless defined $event->{'comment'} and not ref $event->{'comment'}
292 1 2 unless exists $event->{'interval'}
294 1 1 unless defined $event->{'interval'} and $event->{'interval'} =~ /^[\d.]+$/