|
BEGIN {
eval 'require autodie' ;
plan skip_all => 'autodie required' if $@;
plan tests => 3;
}
sub try_but_fail1 {
$! = custom_errstr( "set with custom errstr" );
return ;
}
sub try_but_fail2 {
$! = 999_999_999;
return ;
}
use autodie qw/try_but_fail1 try_but_fail2/ ; register_errstr "set with register errstr" , 999_999_999;
local $!;
throws_ok { try_but_fail1() } qr/set with custom errstr/ , "custom errstr seen by autodie" ;
throws_ok { try_but_fail2() } qr/set with register errstr/ , "register errstr seen by autodie" ;
|