Branch Coverage

blib/lib/File/Hotfolder.pm
Criterion Covered Total %
branch 0 46 0.0


line true false branch
27 0 0 if $_[0] eq 'File::Hotfolder'
28 0 0 @_ % 2 ? :
36 0 0 if $args{'fullname'}
42 0 0 unless -d $path, my $self = bless({'inotify', 'Linux::Inotify2'->new || croak("Unable to create new inotify object: $!"), 'callback', $args{'callback'} || sub { 1; } , 'delete', !!$args{'delete'}, 'print', 0 + ($args{'print'} || 0), 'filter', $args{'filter'}, 'scan', $args{'scan'}, 'catch', $args{'catch'}}, $class)
50 0 0 if $$self{'print'} & 8
63 0 0 if (-d $_) { }
0 0 elsif ($$self{'scan'}) { }
76 0 0 unless (-d $path)
81 0 0 if $$self{'print'} & 1
83 0 0 unless ($self->inotify->watch($path, 4040, sub { my $e = shift(); my $path = $e->fullname; warn "event queue overflowed\n" if $e->IN_Q_OVERFLOW; if ($e->IN_ISDIR) { if ($e->IN_CREATE or $e->IN_MOVED_TO) { $self->watch_recursive($path); } elsif ($e->IN_DELETE_SELF or $e->IN_MOVE_SELF) { say "unwatching $path" if $$self{'print'} & 1; $e->w->cancel; } ; } elsif ($e->IN_CLOSE_WRITE or $e->IN_MOVED_TO) { $self->_callback($path); } ; } ))
90 0 0 if $e->IN_Q_OVERFLOW
92 0 0 if ($e->IN_ISDIR) { }
0 0 elsif ($e->IN_CLOSE_WRITE or $e->IN_MOVED_TO) { }
93 0 0 if ($e->IN_CREATE or $e->IN_MOVED_TO) { }
0 0 elsif ($e->IN_DELETE_SELF or $e->IN_MOVE_SELF) { }
96 0 0 if $$self{'print'} & 1
112 0 0 if ($$self{'filter'} and not $path =~ /$$self{'filter'}/)
116 0 0 if $$self{'print'} & 2
119 0 0 if ($$self{'catch'}) { }
121 0 0 if ($@)
122 0 0 if $$self{'print'} & 8
130 0 0 if ($delete and $$self{'delete'})
131 0 0 if $$self{'print'} & 4