Branch Coverage

blib/lib/Mojo/IOLoop/Stream.pm
Criterion Covered Total %
branch 50 62 80.6


line true false branch
12 347 0 unless ${^GLOBAL_PHASE} eq "DESTRUCT"
14 1 1 unless +(shift())->{'read'}
18 1 1 unless +(shift())->{'written'}
20 13 1 if $_[0]{'handle'}
24 3 685 unless my $reactor = $self->reactor
25 341 344 unless my $handle = delete $self->timeout(0)->{'handle'}
30 104 182 $_[0]->is_writing ? :
42 30 7774 unless $self->{'handle'}
52 0 388 unless $self->{'handle'}
54 1 387 if delete $self->{'paused'}
57 7515 4913 pop() ? :
67 1 0 if $_[0]{'handle'} and not $_[0]{'paused'}++
72 9 4009 unless defined $timeout
76 3272 737 if ($self->{'timer'}) { }
388 349 elsif ($self->{'timeout'}) { }
77 340 2932 if (not $self->{'timeout'}) { }
83 6 0 if $self and delete $self->{'timer'}
95 7457 257 if ($cb) { }
184 73 elsif (not length $self->{'buffer'}) { }
97 7530 0 if $self->{'handle'}
102 9447 2616 if $_[0]{'timer'}
107 4913 0 if (defined(my $read = $self->{'handle'}->sysread(my $buffer, 131072, 0)))
109 89 4824 $read == 0 ? :
113 0 0 if $! == 11 or $! == 4 or $! == 11
116 0 0 $! == 104 ? :
124 6469 1046 if (length $self->{'buffer'})
125 0 6469 unless defined(my $written = $handle->syswrite($self->{'buffer'}))
131 7515 0 unless length $self->{'buffer'}
132 5187 2328 if $self->is_writing
133 58 2270 if $self->{'graceful'}
134 2240 30 if $self->{'handle'}