X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F34exception_action.t;h=aa803eb238bada7b3e1e2693e38f39c096bc427a;hb=HEAD;hp=d326bf7074db312e0e6754905a284e3b5e7b899a;hpb=90a5b0237843707bba83646e8d14f6bf4b782ba5;p=dbsrgits%2FDBIx-Class.git diff --git a/t/34exception_action.t b/t/34exception_action.t index d326bf7..aa803eb 100644 --- a/t/34exception_action.t +++ b/t/34exception_action.t @@ -6,6 +6,7 @@ use warnings; use Test::More; use Test::Exception; use Test::Warn; +use Scalar::Util 'weaken'; use DBICTest; @@ -118,4 +119,19 @@ for my $ap (qw( } $exp_warn, 'Proper warning on encountered antipattern'; } +# ensure we do not get into an infloop +{ + weaken( my $s = $schema ); + + $schema->exception_action(sub{ + $s->throw_exception(@_) + }); + + throws_ok { + $schema->storage->dbh_do(sub { + $_[1]->do('wgwfwfwghawhjsejsethjwetjesjesjsejsetjes') + } ) + } qr/syntax error/i; +} + done_testing;