X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fsearch%2Fselect_chains_unbalanced.t;h=d6026059ae379bf9c3ca1cd18ab43afd9ec00d95;hb=36fd7f073078f8f36277b467910ab68676361edf;hp=d0facb8f6023806d49d199152eac3e9ac4d1ba7b;hpb=00336453444021a6422e05539ff4fc86c703a6b6;p=dbsrgits%2FDBIx-Class.git diff --git a/t/search/select_chains_unbalanced.t b/t/search/select_chains_unbalanced.t index d0facb8..d602605 100644 --- a/t/search/select_chains_unbalanced.t +++ b/t/search/select_chains_unbalanced.t @@ -34,33 +34,30 @@ my @chain = ( => [qw/cdid title foo bar/], { - '+select' => [ 'genreid', $multicol_rs->as_query ], - '+as' => [qw/genreid name rank/], + '+select' => \'unaliased randomness', } => 'SELECT me.cdid, me.title, DISTINCT(foo, bar), - me.genreid, - (SELECT me.name, me.rank FROM artist me WHERE ( artistid 1 )) + unaliased randomness FROM cd me' - => [qw/cdid title foo bar genreid name rank/], - + => [qw/cdid title foo bar/], { - '+select' => { count => 'me.cdid', -as => 'cnt' }, # lack of 'as' infers from '-as' - '+columns' => { len => { length => 'me.title' } }, + '+select' => [ 'genreid', $multicol_rs->as_query ], + '+as' => [qw/genreid name rank/], } => 'SELECT me.cdid, me.title, - LENGTH( me.title ), - COUNT( me.cdid ) AS cnt, DISTINCT(foo, bar), me.genreid, - (SELECT me.name, me.rank FROM artist me WHERE ( artistid 1 )) + (SELECT me.name, me.rank FROM artist me WHERE ( artistid 1 )), + unaliased randomness FROM cd me' - => [qw/cdid title len cnt foo bar genreid name rank/], + => [qw/cdid title foo bar genreid name rank/], { - '+select' => \'unaliased randomness', + '+select' => { count => 'me.cdid', -as => 'cnt' }, # lack of 'as' infers from '-as' + '+columns' => { len => { length => 'me.title' } }, } => 'SELECT me.cdid, me.title, @@ -73,6 +70,7 @@ my @chain = ( FROM cd me' => [qw/cdid title len cnt foo bar genreid name rank/], + ); my $rs = $schema->resultset('CD'); @@ -95,7 +93,7 @@ while (@chain) { is_deeply( $rs->_resolved_attrs->{as}, $as, - 'Correct dbic-side aliasing', + "Correct dbic-side aliasing for test $testno", ); $testno++;