X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F01generate.t;h=008c7ca56a1a17d9acfc3088c405f34d938a5ba5;hb=74156ee902717f09df7ffa18318a99859a30c5a5;hp=f328981b9406cc9cfc3a3aa6086c2bdb3c136e90;hpb=89690da26325b14721e2bbebdf12406b868b3194;p=dbsrgits%2FSQL-Abstract.git diff --git a/t/01generate.t b/t/01generate.t index f328981..008c7ca 100644 --- a/t/01generate.t +++ b/t/01generate.t @@ -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` != ? )',