h my $type (@types) {
$log->$type("Got type '$type'");
}
$cap->stop;
foreach my $type (@types) {
isnt($cap->read =~ /$type/is, '', "Check STDOUT for type '$type'");
}
__END__
vim:set syntax=perl:
{ $log->foo };
is($@, '', 'Using valid type');
# Invalid with default error
eval { $log->bar };
isnt($@, '', 'Using Invalid type with default error');
$log->close;
# Invalid with user defined erro
h my $type (@types) {
$log->$type("Got type '$type'");
}
$cap->stop;
foreach my $type (@types) {
isnt($cap->read =~ /$type/is, '', "Check STDERR for type '$type'");
}
__END__
vim:set syntax=perl:
en my $fh, '<', $file or die "$0: $!\n";
my $text = join '', <$fh>;
foreach my $type (@types) {
isnt($text =~ /$type/s, '', "Custom type '$type'");
}
close $fh;
unlink $file;
__END__
vim:set synta
og::Dynamic', 'Valid instantiation with new()');
# Invalid instantiation
eval { my $log = Log::Dynamic->open };
isnt($@, undef, 'Invalid instantiation');
unlink $file;
__END__
vim:set syntax=perl:
# and the new entries.
open $fh, '<', $file or die "$0: $!\n";
my $text = join '', <$fh>;
close $fh;
isnt($text =~ /OLD.*NEW/s, '', 'Verify append mode');
unlink $file;
__END__
vim:set syntax=perl: