"Fossies" - the Fresh Open Source Software Archive

Member "Parse-Syslog-1.10/t/solaris28.t" (30 Sep 2007, 1001 Bytes) of package /linux/privat/old/Parse-Syslog-1.10.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 use Test;
    2 use lib "lib";
    3 BEGIN { plan tests => 16 };
    4 use Parse::Syslog;
    5 ok(1); # If we made it this far, we're ok.
    6 
    7 #########################
    8 
    9 my $parser = Parse::Syslog->new("t/solaris28-syslog", year=>2001);
   10 open(PARSED, "<t/solaris28-parsed") or die "can't open t/solaris28-parsed: $!\n";
   11 while(my $sl = $parser->next) {
   12 	my $is = '';
   13 	$is .= "time    : ".(localtime($sl->{timestamp}))."\n";
   14 	$is .= "host    : $sl->{host}\n";
   15 	$is .= "program : $sl->{program}\n";
   16 	$is .= "pid     : ".(defined $sl->{pid} ? $sl->{pid} : 'undef')."\n";
   17 	$is .= "msgid   : $sl->{msgid}\n";
   18 	$is .= "facility: $sl->{facility}\n";
   19 	$is .= "level   : $sl->{level}\n";
   20 	$is .= "text    : $sl->{text}\n";
   21 	$is .= "\n";
   22 	print "$is";
   23 
   24 	my $shouldbe = '';
   25 	$shouldbe .= <PARSED>;
   26 	$shouldbe .= <PARSED>;
   27 	$shouldbe .= <PARSED>;
   28 	$shouldbe .= <PARSED>;
   29 	$shouldbe .= <PARSED>;
   30 	$shouldbe .= <PARSED>;
   31 	$shouldbe .= <PARSED>;
   32 	$shouldbe .= <PARSED>;
   33 	$shouldbe .= <PARSED>;
   34 
   35 	ok($is, $shouldbe);
   36 }
   37 
   38 # vim: set filetype=perl: