[...] # Init tests, prepare everything, etc. require 'error.inc'; # Here are the regular handling functions defined, Log_Error is one of them our $ErrorText; our $ErrorLevel; eval { sub Log_Error { ($ErrorText,$ErrorLevel) = @_; return 1; } }; #### # for expected errors: ok($ErrorText eq 'foo','Error-checking'); ok($ErrorLevel eq 'mail','Error-level-checking'); # for tests which shouldn't trigger one: ok($ErrorText eq '','Check for errors');