X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F83cache.t;h=9edfe713799966c0feb33eb8da1a2d0fdcf4b825;hb=a42634cdbf7e969bb9133ff71d2bc2666003d53a;hp=5fd25d34bcee205140b1f5d0b3e4185692c51fab;hpb=8273e845426f0187b4ad6c4a1b42286fa09a648f;p=dbsrgits%2FDBIx-Class.git diff --git a/t/83cache.t b/t/83cache.t index 5fd25d3..9edfe71 100644 --- a/t/83cache.t +++ b/t/83cache.t @@ -116,6 +116,7 @@ $rs = $schema->resultset("Artist")->search( prefetch => { cds => 'tags' }, + order_by => { -desc => 'cds.cdid' }, } ); { @@ -138,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 ) { @@ -162,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 = (); @@ -170,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' );