X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fprefetch%2Fcorrelated.t;h=e941b12a99fcbae0113fa1157c08400f46df3a08;hb=953f8eb062bd84ffcb5b59d9a0d27d1db55f3927;hp=ac809f3f9d77534364052d7fb0cd248ec8f93cb6;hpb=49eeb48de3d8ff685926b595fa0f3f5e680eaee2;p=dbsrgits%2FDBIx-Class.git diff --git a/t/prefetch/correlated.t b/t/prefetch/correlated.t index ac809f3..e941b12 100644 --- a/t/prefetch/correlated.t +++ b/t/prefetch/correlated.t @@ -1,11 +1,12 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Deep; -use lib qw(t/lib); -use DBICTest; -use DBIC::SqlMakerTest; + +use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema(); @@ -14,7 +15,7 @@ my $cdrs = $schema->resultset('CD')->search({ 'me.artist' => { '!=', 2 }}); my $cd_data = { map { $_->cdid => { siblings => $cdrs->search ({ artist => $_->get_column('artist') })->count - 1, - track_titles => [ map { $_->title } ($_->tracks->all) ], + track_titles => [ sort $_->tracks->get_column('title')->all ], }, } ( $cdrs->all ) }; @@ -66,7 +67,7 @@ $schema->is_executed_querycount( sub { cmp_deeply ( { map { $_->cdid => { - track_titles => [ map { $_->title } ($_->tracks->all) ], + track_titles => [ sort map { $_->title } ($_->tracks->all) ], siblings => $_->get_column ('sibling_count'), } } $c_rs->all @@ -130,6 +131,8 @@ is_same_sql_bind( 'Expected SQL on correlated realiased subquery' ); +$schema->storage->disconnect; + # test for subselect identifier leakage # NOTE - the hodge-podge mix of literal and regular identifuers is *deliberate* for my $quote_names (0,1) {