regularise more code, switch one test from die to warn verification
[scpubgit/Q-Branch.git] / t / 01generate.t
index ebe3aad..3e55f15 100644 (file)
@@ -726,9 +726,6 @@ for my $lhs (undef, '') {
     [ foo => "bar", $lhs => \["baz"], bizz => "buzz" ],
     [ $lhs => \"baz" ],
     [ $lhs => \["baz"] ],
-
-    # except for this one, that is automagically arrayified
-    { foo => "bar", -or => { $lhs => \"baz" }, bizz => "buzz" },
   ) {
     push @tests, {
       func => 'where',
@@ -741,6 +738,7 @@ for my $lhs (undef, '') {
 ## deprecations - sorta worked, likely abused by folks
   for my $where_arg (
     # the arrayref forms of this never worked and throw above
+    { foo => "bar", -or => { $lhs => \"baz" }, bizz => "buzz" },
     { foo => "bar", -and => { $lhs => \"baz" }, bizz => "buzz" },
     { foo => "bar", $lhs => \"baz", bizz => "buzz" },
     { foo => "bar", $lhs => \["baz"], bizz => "buzz" },
@@ -850,10 +848,12 @@ for my $t (@tests) {
       ) || diag dumper({ args => $t->{args}, result => $stmt });
     }
     else {
-      warnings_like(
-        sub { $cref->() },
-        $t->{warns} || [],
-      ) || diag dumper({ args => $t->{args}, result => $stmt });
+      lives_ok(sub {
+        warnings_like(
+          sub { $cref->() },
+          $t->{warns} || [],
+        ) || diag dumper({ args => $t->{args}, result => $stmt });
+      }) || diag dumper({ args => $t->{args}, result => $stmt, threw => $@ });
 
       is_same_sql_bind(
         $stmt,