[Bast-commits] r5780 - SQL-Abstract/1.x/trunk/t

ribasushi at dev.catalyst.perl.org ribasushi at dev.catalyst.perl.org
Thu Mar 19 21:18:02 GMT 2009


Author: ribasushi
Date: 2009-03-19 21:18:02 +0000 (Thu, 19 Mar 2009)
New Revision: 5780

Modified:
   SQL-Abstract/1.x/trunk/t/02where.t
Log:
Correct nested modifier tests

Modified: SQL-Abstract/1.x/trunk/t/02where.t
===================================================================
--- SQL-Abstract/1.x/trunk/t/02where.t	2009-03-19 21:07:06 UTC (rev 5779)
+++ SQL-Abstract/1.x/trunk/t/02where.t	2009-03-19 21:18:02 UTC (rev 5780)
@@ -211,14 +211,18 @@
 );
 
 # add extra modifier tests, based on 2 outcomes
-my $mod_and = {
+my $mod_or_and = {
   stmt => 'WHERE ( foo = ? OR bar = ? ) AND baz = ? ',
   bind => [qw/1 2 3/],
 };
-my $mod_or = {
+my $mod_or_or = {
   stmt => 'WHERE ( foo = ? OR bar = ? ) OR baz = ?',
   bind => [qw/1 2 3/],
 };
+my $mod_and_or = {
+  stmt => 'WHERE ( foo = ? AND bar = ? ) OR baz = ?',
+  bind => [qw/1 2 3/],
+};
 
 push @handle_tests, (
    # test modifiers within hashrefs
@@ -227,14 +231,14 @@
         [ foo => 1, bar => 2 ],
         baz => 3,
       ]},
-      %$mod_or,
+      %$mod_or_or,
    },
    {
       where => { -and => [
         [ foo => 1, bar => 2 ],
         baz => 3,
       ]},
-      %$mod_and,
+      %$mod_or_and,
    },
 
    # test modifiers within arrayrefs
@@ -243,46 +247,46 @@
         [ foo => 1, bar => 2 ],
         baz => 3,
       ]],
-      %$mod_or,
+      %$mod_or_or,
    },
    {
       where => [ -and => [
         [ foo => 1, bar => 2 ],
         baz => 3,
       ]],
-      %$mod_and,
+      %$mod_or_and,
    },
 
-   # test conflicting modifiers within hashrefs (last one should win?)
+   # test ambiguous modifiers within hashrefs (op extends to to immediate RHS only)
    {
       where => { -and => [ -or =>
         [ foo => 1, bar => 2 ],
         baz => 3,
       ]},
-      %$mod_or,
+      %$mod_or_and,
    },
    {
       where => { -or => [ -and =>
         [ foo => 1, bar => 2 ],
         baz => 3,
       ]},
-      %$mod_and,
+      %$mod_and_or,
    },
 
-   # test conflicting modifiers within arrayrefs (last one should win?)
+   # test ambiguous modifiers within arrayrefs (op extends to to immediate RHS only)
    {
       where => [ -and => [ -or =>
         [ foo => 1, bar => 2 ],
         baz => 3,
       ]],
-      %$mod_or,
+      %$mod_or_and,
    },
    {
       where => [ -or => [ -and =>
         [ foo => 1, bar => 2 ],
         baz => 3,
       ]],
-      %$mod_and,
+      %$mod_and_or,
    },
 );
 




More information about the Bast-commits mailing list