single fire -nest warning because DBIC expects it, fix an order_by bug
[dbsrgits/SQL-Abstract.git] / t / 01generate.t
index f328981..008c7ca 100644 (file)
@@ -16,6 +16,11 @@ use SQL::Abstract;
 #
 #################
 
+# DBIx::Class requires a nest warning to be emitted once but the private
+# method it overrode to do so no longer exists; here we cancel said warning
+# to avoid disturbing the SQLA tests
+
+$SQL::Abstract::Nest_Warning_Emitted++;
 
 my @tests = (
       {
@@ -75,6 +80,14 @@ my @tests = (
               bind   => ['boom']
       },
       {
+              # this is maybe wrong but a single arg doesn't get quoted
+              func   => 'select',
+              args   => ['test', 'id', { a => { '!=', 'boom' } }],
+              stmt   => 'SELECT id FROM test WHERE ( a != ? )',
+              stmt_q => 'SELECT id FROM `test` WHERE ( `a` != ? )',
+              bind   => ['boom']
+      },
+      {
               func   => 'update',
               args   => ['test', {a => 'boom'}, {a => undef}],
               stmt   => 'UPDATE test SET a = ? WHERE ( a IS NULL )',
@@ -83,6 +96,13 @@ my @tests = (
       },
       {
               func   => 'update',
+              args   => ['test', {a => undef }, {a => 'boom'}],
+              stmt   => 'UPDATE test SET a = ? WHERE ( a = ? )',
+              stmt_q => 'UPDATE `test` SET `a` = ? WHERE ( `a` = ? )',
+              bind   => [undef,'boom']
+      },
+      {
+              func   => 'update',
               args   => ['test', {a => 'boom'}, { a => {'!=', "bang" }} ],
               stmt   => 'UPDATE test SET a = ? WHERE ( a != ? )',
               stmt_q => 'UPDATE `test` SET `a` = ? WHERE ( `a` != ? )',