Test-Tail-Multi

 view release on metacpan or  search on metacpan

lib/Test/Tail/Multi.pm  view on Meta::CPAN

  $Test->diag($comment) if defined $comment;
}


sub add_file($;$) {
  my($file, $comment) = @_;
  push @monitored, File::Tail->new($file);
  $Test->diag($comment) if defined $comment;
}

sub contents_like(&$;$) {
  my ($coderef, $pattern, $comment) = @_;
  _execute($coderef, $pattern, sub { $Test->like(@_) }, $comment);
}

sub contents_unlike(&$;$) {
  my ($coderef, $pattern, $comment) = @_;
  _execute($coderef, $pattern, sub { $Test->unlike(@_) }, $comment);
}

sub _execute {
  my ($coderef, $pattern, $testsub, $comment) = @_;
  if (defined $coderef) {
    # call code and capture output
    $coderef->();
    my ($nfound, $timeleft, @pending);



( run in 0.365 second using v1.01-cache-2.11-cpan-a9ef4e587e4 )