Branch Coverage

blib/lib/MCE/Stream.pm
Criterion Covered Total %
branch 125 240 52.0


line true false branch
30 0 0 if $INC{'threads.pm'}
53 10 0 unless ($_pkg =~ /^MCE::/)
64 0 0 if $_arg eq "max_workers"
65 0 0 if $_arg eq "chunk_size"
66 0 0 if $_arg eq "tmp_dir"
67 0 0 if $_arg eq "freeze"
68 0 0 if $_arg eq "thaw"
69 0 0 if $_arg eq "init_relay"
70 0 0 if $_arg eq "use_threads"
71 0 0 if $_arg eq "default_mode"
73 0 0 if $_arg eq "fast"
76 0 0 if ($_arg eq "sereal")
77 0 0 if (shift() eq 0)
89 0 10 if $_p->{'DEFAULT_MODE'} ne "grep" and $_p->{'DEFAULT_MODE'} ne "map"
95 0 10 unless $_p->{'CHUNK_SIZE'} eq "auto"
113 185 194 if (defined $_gather_ref) { }
115 185 185 unless exists $_tmp{$_order_id}
131 51 51 if (defined $_mce->{'user_tasks'}[$_task_id + 1])
139 0 102 if exists $_params->{'task_end'} and ref $_params->{'task_end'} eq "CODE"
152 9 0 if defined $_[0] and $_[0] eq "MCE::Stream"
155 0 9 ref $_[0] eq 'HASH' ? :
158 0 9 if ref $_params->{$_pkg}{'input_data'} eq "HASH"
167 24 0 if defined $_[0] and $_[0] eq "MCE::Stream"
168 18 6 defined $_[0] ? :
170 10 14 if ($_pkg eq 'MCE') { }
6 8 elsif ($_MCE->{$_pkg} and $_MCE->{$_pkg}{'_init_pid'} eq "$$.$_tid") { }
174 6 0 if $_MCE->{$_pkg}{'_spawned'}
184 6 0 if (defined $_queue->{$_pkg})
204 0 20 if defined $_[0] and $_[0] eq "MCE::Stream"
206 0 20 ref $_[0] eq 'HASH' ? :
209 20 0 if (defined(my $_p = $_params->{$_pid})) { }
210 0 20 if exists $_p->{'input_data'}
211 0 20 if exists $_p->{'sequence'}
219 10 30 if ($_r eq "" or $_r eq "SCALAR" or $_r =~ /^(?:GLOB|FileHandle|IO::)/)
225 10 10 if (defined $_file and ref $_file eq '' and $_file ne '') { }
10 0 elsif (ref $_file eq 'SCALAR' or ref($_file) =~ /^(?:GLOB|FileHandle|IO::)/) { }
226 0 10 unless -e $_file
227 0 10 unless -r $_file
228 0 10 unless -f $_file
238 20 0 if (defined $_pos)
253 0 10 if defined $_[0] and $_[0] eq "MCE::Stream"
255 0 10 ref $_[0] eq 'HASH' ? :
258 10 0 if (defined(my $_p = $_params->{$_pid})) { }
259 0 10 if exists $_p->{'sequence'}
260 0 10 if exists $_p->{'input_data'}
261 0 10 if exists $_p->{'_file'}
270 0 15 if ($_r eq "" or $_r =~ /^Math::/ or $_r eq "HASH" or $_r eq "ARRAY")
273 10 0 if ($_r eq '' or $_r =~ /^Math::/) { }
0 0 elsif ($_r eq 'HASH') { }
0 0 elsif ($_r eq 'ARRAY') { }
293 0 10 unless exists $_params->{$_pid}{'sequence'}
294 0 10 unless defined $_begin
296 0 10 unless defined $_end
301 10 0 if (defined $_pos)
316 0 59 if defined $_[0] and $_[0] eq "MCE::Stream"
318 30 29 caller() eq 'MCE::Stream' ? :
321 0 59 if (ref $_[0] eq "HASH" and not exists $_[0]{'code'})
322 0 0 unless defined $_params->{$_pid}
330 25 34 if ref $_[0] eq "ARRAY"
334 25 34 if (defined $_aref) { }
346 108 10 if (ref $_[0] eq 'CODE') { }
351 0 0 unless exists $_[0]{'code'} or exists $_[0]{'mode'}
353 10 0 exists $_[0]{'code'} ? :
354 10 0 exists $_[0]{'mode'} ? :
356 0 10 unless (ref $_code[-1] eq "CODE")
359 0 10 if ($_mode[-1] ne "grep" and $_mode[-1] ne "map")
364 118 0 if (defined(my $_p = $_params->{$_pid}))
366 118 0 ref $_p->{'task_name'} eq 'ARRAY' ? :
368 118 0 ref $_p->{'max_workers'} eq 'ARRAY' ? :
373 28 90 if not defined $_prev_c->{$_pid}[$_pos] or $_prev_c->{$_pid}[$_pos] != $_code[$_pos]
377 28 90 if not defined $_prev_m->{$_pid}[$_pos] or $_prev_m->{$_pid}[$_pos] ne $_mode[$_pos]
380 28 90 if $_prev_n->{$_pid}[$_pos] ne $_name[$_pos]
381 28 90 if $_prev_w->{$_pid}[$_pos] ne $_wrks[$_pos]
391 0 59 if (defined $_prev_c->{$_pid}[$_pos])
400 0 59 unless scalar @_code
407 10 49 if (@_ == 1 and $_r =~ /^(?:ARRAY|HASH|SCALAR|GLOB|FileHandle|IO::)/)
408 0 10 if $_r eq "HASH"
413 59 0 if (defined(my $_p = $_params->{$_pid}))
415 0 59 if exists $_p->{'max_workers'} and ref $_p->{'max_workers'} ne "ARRAY"
417 29 30 if defined $_input_data or scalar @_
418 0 59 if exists $_p->{'user_func'}
419 0 59 if exists $_p->{'user_tasks'}
420 0 59 if exists $_p->{'use_slurpio'}
421 0 59 if exists $_p->{'bounds_only'}
422 0 59 if exists $_p->{'gather'}
425 59 0 if (@_code > 1 and $_max_workers > 1)
433 0 59 defined $_p->{'init_relay'} || defined $_def->{$_pkg}{'INIT_RELAY'} ? :
438 59 0 if (defined(my $_p = $_params->{$_pid}))
439 20 39 if (exists $_p->{'_file'}) { }
442 0 39 if exists $_p->{'input_data'}
450 14 45 if ($_init_mce or not exists $_queue->{$_pid}) { }
451 0 14 if defined $_MCE->{$_pid}
452 14 0 unless defined $_queue->{$_pid}
471 14 0 if (defined(my $_p = $_params->{$_pid}))
475 0 28 if $_ eq "sequence_run"
476 14 14 if $_ eq "max_workers" and ref $_p->{'max_workers'} eq "ARRAY"
477 14 0 if $_ eq "task_name" and ref $_p->{'task_name'} eq "ARRAY"
478 0 0 if $_ eq "input_data"
479 0 0 if $_ eq "chunk_size"
480 0 0 if $_ eq "task_end"
483 0 0 unless exists $MCE::_valid_fields_new{$_}
491 0 70 if exists $_def->{$_pkg}{uc $_k} and not exists $_opts{$_k}
499 45 0 if (defined(my $_p = $_params->{$_pid}))
505 0 675 if exists $_p->{$_k}
512 30 29 if (defined $_input_data) { }
19 10 elsif (scalar @_) { }
522 10 0 if (defined $_params->{$_pid} and exists $_params->{$_pid}{'sequence'})
527 10 0 if (exists $_params->{$_pid}{'sequence_run'})
538 0 51 unless ($_MCE->{$_pid}{'_spawned'})
543 26 25 unless defined $_aref
581 65 18 if (ref $_chunk_ref) { }
584 56 9 $_mode_ref->[-1] eq 'map' ? :
589 18 0 $_mode_ref->[-1] eq 'map' ? :
592 83 0 @{$_code_ref;} > 1 ? :
597 14 0 @{$_code_ref;} > 1 ? :
614 0 0 unless defined $_chunk
621 0 0 $_mode_ref->[$_pos] eq 'map' ? :
633 14 0 if (@{$_code_ref;} > 1)
645 22 83 unless defined $_chunk
652 83 0 $_mode_ref->[0] eq 'map' ? :