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 8 679 unless my $reactor = $self->reactor
25 340 339 unless my $handle = delete $self->timeout(0)->{'handle'}
30 102 181 $_[0]->is_writing ? :
42 30 7848 unless $self->{'handle'}
52 0 388 unless $self->{'handle'}
54 1 387 if delete $self->{'paused'}
57 7592 4976 pop() ? :
67 1 0 if $_[0]{'handle'} and not $_[0]{'paused'}++
72 9 3966 unless defined $timeout
76 3230 736 if ($self->{'timer'}) { }
388 348 elsif ($self->{'timeout'}) { }
77 335 2895 if (not $self->{'timeout'}) { }
83 6 0 if $self and delete $self->{'timer'}
95 7535 256 if ($cb) { }
183 73 elsif (not length $self->{'buffer'}) { }
97 7608 0 if $self->{'handle'}
102 9532 2672 if $_[0]{'timer'}
107 4976 0 if (defined(my $read = $self->{'handle'}->sysread(my $buffer, 131072, 0)))
109 90 4886 $read == 0 ? :
113 0 0 if $! == 11 or $! == 4 or $! == 11
116 0 0 $! == 104 ? :
124 6559 1033 if (length $self->{'buffer'})
125 0 6559 unless defined(my $written = $handle->syswrite($self->{'buffer'}))
131 7592 0 unless length $self->{'buffer'}
132 5289 2303 if $self->is_writing
133 57 2246 if $self->{'graceful'}
134 2216 30 if $self->{'handle'}