Port tests and extra operator from master 40f2f231
[dbsrgits/SQL-Abstract.git] / t / 01generate.t
index 8e7caf1..72bdd6c 100644 (file)
@@ -608,6 +608,25 @@ my @tests = (
       },
 );
 
+# check is( not) => undef
+for my $op ( qw(not is is_not), 'is not' ) {
+  (my $sop = uc $op) =~ s/_/ /gi;
+
+  $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 => [],
+      };
+    }
+  }
+}
+
 for my $t (@tests) {
   local $"=', ';