X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F21op_ident.t;h=7fe09d3423f9881ce15b3cfed83cfef6b37c0d57;hb=a01911a20b326afd1a45f97f14aca68206708eba;hp=29ff46fa347433e97daff1e23dd75075479173de;hpb=8aa76984c08d55d3a4e37ce4fde6c9f7169e2e6e;p=dbsrgits%2FSQL-Abstract.git diff --git a/t/21op_ident.t b/t/21op_ident.t index 29ff46f..7fe09d3 100644 --- a/t/21op_ident.t +++ b/t/21op_ident.t @@ -17,7 +17,7 @@ for my $q ('', '"') { $sql_maker->where({ foo => { -ident => undef } }) } qr/-ident requires a single plain scalar argument/; - my ($sql, @bind) = $sql_maker->select ('artist', '*', { 'artist.name' => { -ident => 'artist.pseudonym' } } ); + my ($sql, @bind) = $sql_maker->select('artist', '*', { 'artist.name' => { -ident => 'artist.pseudonym' } } ); is_same_sql_bind ( $sql, \@bind, @@ -28,7 +28,7 @@ for my $q ('', '"') { [], ); - ($sql, @bind) = $sql_maker->update ('artist', + ($sql, @bind) = $sql_maker->update('artist', { 'artist.name' => { -ident => 'artist.pseudonym' } }, { 'artist.name' => { '!=' => { -ident => 'artist.pseudonym' } } }, ); @@ -41,6 +41,18 @@ for my $q ('', '"') { ", [], ); + + ($sql) = $sql_maker->select( + \(my $from = 'foo JOIN bar ON foo.bar_id = bar.id'), + [ { -ident => [ 'foo', 'name' ] }, { -ident => [ 'bar', '*' ] } ] + ); + + is_same_sql_bind( + $sql, + undef, + "SELECT ${q}foo${q}.${q}name${q}, ${q}bar${q}.* + FROM $from" + ); } done_testing;