X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F00new.t;h=f6aecfe1acbd2cd930e20128fbe88fe443ffaa3c;hb=3cdadcbe;hp=5da3446cedadf6add33853f6322bc473a1e3967b;hpb=46dc2f3e47d514cd376003cea2df63222c492b0b;p=dbsrgits%2FSQL-Abstract.git diff --git a/t/00new.t b/t/00new.t index 5da3446..f6aecfe 100644 --- a/t/00new.t +++ b/t/00new.t @@ -1,6 +1,7 @@ use strict; use warnings; use Test::More; +use Test::Warn; use SQL::Abstract::Test import => ['is_same_sql']; use SQL::Abstract; @@ -82,16 +83,20 @@ my @handle_tests = ( { a => [qw/b c d/], e => { '!=', [qw(f g)] }, q => { 'not in', [14..20] } } ], + warns => qr/\QA multi-element arrayref as an argument to the inequality op '!=' is technically equivalent to an always-true 1=1/, }, ); for (@handle_tests) { my $sqla = SQL::Abstract->new($_->{args}); - my($stmt) = $sqla->select( - 'test', - '*', - $_->{where} || { a => 4, b => 0} - ); + my $stmt; + warnings_exist { + $stmt = $sqla->select( + 'test', + '*', + $_->{where} || { a => 4, b => 0} + ); + } $_->{warns} || []; is_same_sql($stmt, $_->{stmt}); }