X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fprefetch%2Fcorrelated.t;h=e941b12a99fcbae0113fa1157c08400f46df3a08;hb=c0329273268971824784f239f32c7246e68da9c5;hp=6c2e0b769b5cd83437b6ffa21e96a92d3dee4c1e;hpb=a5a7bb733a940db710b7408508374833683a2e79;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/t/prefetch/correlated.t b/t/prefetch/correlated.t index 6c2e0b7..e941b12 100644 --- a/t/prefetch/correlated.t +++ b/t/prefetch/correlated.t @@ -1,9 +1,11 @@ +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 ':DiffSQL'; my $schema = DBICTest->init_schema(); @@ -13,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 ) }; @@ -65,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 @@ -129,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) {