Help-Site Computer Manuals
Software
Hardware
Programming
Networking
  Algorithms & Data Structures   Programming Languages   Revision Control
  Protocols
  Cameras   Computers   Displays   Keyboards & Mice   Motherboards   Networking   Printers & Scanners   Storage
  Windows   Linux & Unix   Mac

TestCommon::LogDiff
get log file diffs

TestCommon::LogDiff - get log file diffs


NAME

TestCommon::LogDiff - get log file diffs


Synopsis


  use TestCommon::LogDiff;

  use Apache::Test;

  plan tests => 2;

  my $path = "/tmp/mylog";

  open my $fh, ">>$path" or die "Can't open $path: $!";

  my $logdiff = TestCommon::LogDiff->new($path);

  print $fh "foo 123\n";

  my $expected = qr/^foo/;

  ok t_cmp $logdiff->diff, $expected;

  print $fh "bar\n";

  my $expected = 'bar';

  ok t_cmp $logdiff->diff, $expected;


Description

Useful for testing the warning, error and other messages going into the log file.


API

new

open the log file and point the filehandle pointer to its end.

diff

extract any newly logged information since the last check and move the filehandle to the end of the file.

Programminig
Wy
Wy
yW
Wy
Programming
Wy
Wy
Wy
Wy