1use Test; 2use lib "lib"; 3BEGIN { plan tests => 4 }; 4use Parse::Syslog; 5ok(1); # If we made it this far, we're ok. 6 7######################### 8 9my $parser = Parse::Syslog->new("t/misc-syslog", year=>2002); 10open(PARSED, "<t/misc-parsed") or die "can't open t/misc-parsed: $!\n"; 11while(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 .= "text : $sl->{text}\n"; 18 $is .= "\n"; 19 print "$is"; 20 21 my $shouldbe = ''; 22 $shouldbe .= <PARSED>; 23 $shouldbe .= <PARSED>; 24 $shouldbe .= <PARSED>; 25 $shouldbe .= <PARSED>; 26 $shouldbe .= <PARSED>; 27 $shouldbe .= <PARSED>; 28 29 ok($is, $shouldbe); 30} 31 32# vim: set filetype=perl: 33