X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F83cache.t;h=9edfe713799966c0feb33eb8da1a2d0fdcf4b825;hb=bedbc8111dbbb98f89a36c3cf4e2f6903a4b01be;hp=91b226c7ae9f98d150670ed62657c0aeed6e431e;hpb=81549fa6a3463469696741a51eb3de1f99825fed;p=dbsrgits%2FDBIx-Class.git diff --git a/t/83cache.t b/t/83cache.t index 91b226c..9edfe71 100644 --- a/t/83cache.t +++ b/t/83cache.t @@ -1,5 +1,5 @@ use strict; -use warnings; +use warnings; use Test::More; use lib qw(t/lib); @@ -74,8 +74,6 @@ $rs = $schema->resultset("Artist")->search( } ); -use Data::Dumper; $Data::Dumper::Deparse = 1; - # start test for prefetch SELECT count $queries = 0; $schema->storage->debug(1); @@ -118,6 +116,7 @@ $rs = $schema->resultset("Artist")->search( prefetch => { cds => 'tags' }, + order_by => { -desc => 'cds.cdid' }, } ); { @@ -140,16 +139,9 @@ $artist = ($rs->all)[0]; is($queries, 1, 'only one SQL statement executed'); -$schema->storage->debug($sdebug); -$schema->storage->debugcb (undef); - -my @objs; -#$artist = $rs->find(1); - $queries = 0; -$schema->storage->debug(1); -$schema->storage->debugcb ($debugcb); +my @objs; my $cds = $artist->cds; my $tags = $cds->next->tags; while( my $tag = $tags->next ) { @@ -164,7 +156,7 @@ while( my $tag = $tags->next ) { push @objs, $tag->id; #warn "tag: ", $tag->ID; } -is_deeply( \@objs, [ 1 ], 'second cd has correct tags' ); +is_deeply( [ sort @objs] , [ 2, 5, 8 ], 'third cd has correct tags' ); $tags = $cds->next->tags; @objs = (); @@ -172,7 +164,7 @@ while( my $tag = $tags->next ) { push @objs, $tag->id; #warn "tag: ", $tag->ID; } -is_deeply( \@objs, [ 2, 5, 8 ], 'third cd has correct tags' ); +is_deeply( \@objs, [ 1 ], 'second cd has correct tags' ); is( $queries, 0, 'no additional SQL statements while checking nested data' );