From: Matt S Trout Date: Fri, 7 Sep 2018 23:43:58 +0000 (+0000) Subject: include exception for 00new failures X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f49ccffdc0a5cd2818f09faed6e4c0b646537d9d;hp=d13725da15053d1372b1077bf5de9a914475ab21;p=scpubgit%2FQ-Branch.git include exception for 00new failures --- 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}); }