From: Peter Rabbitson Date: Thu, 19 Mar 2009 21:18:02 +0000 (+0000) Subject: Correct nested modifier tests X-Git-Tag: v1.70~208 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1610db0d05f402c04a7f747de60a7fd714231f18;hp=97b9b66e0a59d13fc2a286a4a595e7f97d1cf465;p=dbsrgits%2FSQL-Abstract.git Correct nested modifier tests --- diff --git a/t/02where.t b/t/02where.t index 50209d2..39d620e 100755 --- a/t/02where.t +++ b/t/02where.t @@ -211,14 +211,18 @@ my @handle_tests = ( ); # 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 @@ push @handle_tests, ( [ 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 @@ push @handle_tests, ( [ 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, }, );