Fix syntax error in example
[dbsrgits/SQL-Abstract.git] / t / 02where.t
index d1e2ee6..4c21045 100644 (file)
@@ -123,6 +123,14 @@ my @handle_tests = (
 
     {
         where => {
+            requestor => [undef, ''],
+        },
+        stmt => " WHERE ( requestor IS NULL OR requestor = ? )",
+        bind => [''],
+    },
+
+    {
+        where => {
             priority  => [ {'>', 3}, {'<', 1} ],
             requestor => { '!=', undef },
         },
@@ -335,12 +343,12 @@ my @handle_tests = (
 # Op against random functions (these two are oracle-specific)
    {
        where => { timestamp => { '!=' => { -trunc => { -year => \'sysdate' } } } },
-       stmt => " WHERE ( timestamp != TRUNC (YEAR sysdate) )",
+       stmt => " WHERE ( timestamp != TRUNC(YEAR(sysdate)) )",
        bind => [],
    },
    {
        where => { timestamp => { '>=' => { -to_date => '2009-12-21 00:00:00' } } },
-       stmt => " WHERE ( timestamp >= TO_DATE ? )",
+       stmt => " WHERE ( timestamp >= TO_DATE(?) )",
        bind => ['2009-12-21 00:00:00'],
    },
 
@@ -419,7 +427,7 @@ for my $case (@handle_tests) {
     my $sql = SQL::Abstract->new;
     my ($stmt, @bind);
     lives_ok {
-      warnings_exist {
+      warnings_like {
         ($stmt, @bind) = $sql->where($case->{where}, $case->{order});
       } $case->{warns} || [];
     };