X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F10test.t;h=2e1e55968d41aee396cc8defc9c3e1533f04dc92;hb=cf5b7ab163f8ac123ebc9bb1156e79646cd5bd2f;hp=60d10d7a36820b0e83f09cfa0d11adf8021a0f8c;hpb=7d27345242d34aa0ad38e3a5f54d0bd09b558d32;p=scpubgit%2FQ-Branch.git diff --git a/t/10test.t b/t/10test.t index 60d10d7..2e1e559 100644 --- a/t/10test.t +++ b/t/10test.t @@ -972,7 +972,7 @@ my @bind_tests = ( }, ); -for my $test ( @sql_tests ) { +for my $test (@sql_tests) { # this does not work on 5.8.8 and earlier :( #local @{*SQL::Abstract::Test::}{keys %{$test->{opts}}} = map { \$_ } values %{$test->{opts}} @@ -1093,4 +1093,17 @@ like( 'expected debug of missing branch', ); + +ok (eq_sql_bind ( + \[ 'SELECT foo FROM bar WHERE baz = ? or buzz = ?', [ {} => 1 ], 2 ], + 'SELECT foo FROM bar WHERE (baz = ?) OR buzz = ?', + [ [ {} => 1 ], 2 ], +), 'arrayrefref unpacks correctly' ); + +is_same_sql_bind( + \[ 'SELECT foo FROM bar WHERE baz = ? or buzz = ?', [ {} => 1 ], 2 ], + \[ 'SELECT foo FROM bar WHERE (( baz = ? OR (buzz = ?) ))', [ {} => 1 ], 2 ], + 'double arrayrefref unpacks correctly' +); + done_testing;