X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F00new.t;h=7cb7103baffdeace11be86be02c914e2e9de21bf;hb=47662caa5fb4467570af9f7b0fb3dffca20c7ed7;hp=f6aecfe1acbd2cd930e20128fbe88fe443ffaa3c;hpb=3cdadcbe32e98b018af5bca2d8270b13d2d2a77a;p=scpubgit%2FQ-Branch.git diff --git a/t/00new.t b/t/00new.t index f6aecfe..7cb7103 100644 --- a/t/00new.t +++ b/t/00new.t @@ -2,8 +2,9 @@ use strict; use warnings; use Test::More; use Test::Warn; +use Test::Exception; -use SQL::Abstract::Test import => ['is_same_sql']; +use SQL::Abstract::Test import => [ qw(is_same_sql dumper) ]; use SQL::Abstract; my @handle_tests = ( @@ -90,13 +91,15 @@ my @handle_tests = ( for (@handle_tests) { my $sqla = SQL::Abstract->new($_->{args}); my $stmt; - warnings_exist { - $stmt = $sqla->select( - 'test', - '*', - $_->{where} || { a => 4, b => 0} - ); - } $_->{warns} || []; + lives_ok(sub { + (warnings_exist { + $stmt = $sqla->select( + 'test', + '*', + $_->{where} || { a => 4, b => 0} + ); + } $_->{warns} || []) || diag dumper($_); + }) or diag dumper({ %$_, threw => $@ }); is_same_sql($stmt, $_->{stmt}); }