From: Matt S Trout Date: Sun, 16 Sep 2018 20:46:41 +0000 (+0000) Subject: trap exceptions and show expr expansion in 02where X-Git-Tag: v1.90_01~460 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ac75bf30842674031fce148a0631b966cbf9a4a6;p=dbsrgits%2FSQL-Abstract.git trap exceptions and show expr expansion in 02where --- diff --git a/t/02where.t b/t/02where.t index 229770b..7c4851b 100644 --- a/t/02where.t +++ b/t/02where.t @@ -2,7 +2,8 @@ use strict; use warnings; use Test::More; use Test::Warn; -use SQL::Abstract::Test import => [qw(is_same_sql_bind diag_where) ]; +use Test::Exception; +use SQL::Abstract::Test import => [qw(is_same_sql_bind diag_where dumper) ]; use SQL::Abstract; @@ -396,12 +397,14 @@ my @handle_tests = ( for my $case (@handle_tests) { my $sql = SQL::Abstract->new; my ($stmt, @bind); - warnings_exist { - ($stmt, @bind) = $sql->where($case->{where}, $case->{order}); - } $case->{warns} || []; + lives_ok { + warnings_exist { + ($stmt, @bind) = $sql->where($case->{where}, $case->{order}); + } $case->{warns} || []; + }; is_same_sql_bind($stmt, \@bind, $case->{stmt}, $case->{bind}) - || diag_where ( $case->{where} ); + || do { diag_where ( $case->{where} ); diag dumper($sql->_expand_expr($case->{where})) }; } done_testing;