File: 01log.t

package info (click to toggle)
libxtm-perl 0.36-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,524 kB
  • ctags: 398
  • sloc: perl: 21,621; makefile: 37
file content (23 lines) | stat: -rw-r--r-- 453 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# -*-perl-*-
use strict;
use Test;
BEGIN { plan tests => 3 }
 
use XTM;
use XTM::Log (qw(elog flog));

$XTM::Log::loglevel = 5;

my $s = { a => 'b', c => 'd' };

my $logfile = "/tmp/xtm$$.log";
open (STDERR, ">$logfile");
elog ('Log Test', 5, "hi", $s);
close STDERR;

use File::Slurp;
ok (grep (/test/i,      read_file($logfile)));
ok (grep (/hi/,         read_file($logfile)));
ok (grep (/'c' => 'd'/, read_file($logfile)));

unlink "/tmp/xtm$$.log";