X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F01generate.t;h=245ca557c301e43c29c66170686cb27a47c9e88b;hb=40f2f2311d048aece00793477ab4b734d20f57bc;hp=e3737ffd421f3575f4c09075f22656514805f3f3;hpb=904c36212d6024755df9c19a5f32b3e8c290bcd4;p=dbsrgits%2FSQL-Abstract.git diff --git a/t/01generate.t b/t/01generate.t index e3737ff..245ca55 100644 --- a/t/01generate.t +++ b/t/01generate.t @@ -555,16 +555,22 @@ my @tests = ( ); # check is( not) => undef -for my $op (qw( is is_not), 'is not' ) { +for my $op ( qw(not is is_not), 'is not' ) { (my $sop = uc $op) =~ s/_/ /gi; - push @tests, { - func => 'where', - args => [{ a => { "$_$op" => undef } }], - stmt => "WHERE a $sop NULL", - stmt_q => "WHERE `a` $sop NULL", - bind => [], - } for ('', '-'); # with and without - + $sop = 'IS NOT' if $sop eq 'NOT'; + + for my $uc (0, 1) { + for my $prefix ('', '-') { + push @tests, { + func => 'where', + args => [{ a => { ($prefix . ($uc ? uc $op : lc $op) ) => undef } }], + stmt => "WHERE a $sop NULL", + stmt_q => "WHERE `a` $sop NULL", + bind => [], + }; + } + } } # check single-element inequality ops for no warnings @@ -655,10 +661,10 @@ for my $t (@tests) { ) || diag dumper ({ args => $t->{args}, result => $stmt }); } else { - warnings_exist( + warnings_like( sub { $cref->() }, $t->{warns} || [], - ); + ) || diag dumper ({ args => $t->{args}, result => $stmt }); is_same_sql_bind( $stmt,