From: Luke Saunders Date: Tue, 18 May 2010 15:53:16 +0000 (+0100) Subject: added new test for detecting cache interference with prefetch etc X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ce0b960497356c8bd1fa1e58224a722f321a8193;p=dbsrgits%2FDBIx-Class-ResultSet-WithMetaData.git added new test for detecting cache interference with prefetch etc --- diff --git a/t/custom_methods.t b/t/custom_methods.t index d32448e..7c8c64a 100644 --- a/t/custom_methods.t +++ b/t/custom_methods.t @@ -1,6 +1,6 @@ #!perl -use Test::More tests => 3; +use Test::More; use lib qw(t/lib); use DBICTest; use Data::Dumper; @@ -49,25 +49,33 @@ ok(my $schema = DBICTest->init_schema(), 'got schema'); { my $artists = $schema->resultset('Artist')->order_by(col => 'artistid')->with_substr->search({}, { prefetch => 'cds', rows => 1 })->display(); - use Data::Dumper; print Dumper($artists); exit; is_deeply($artists, [ - { - 'artistid' => '1', - 'name' => 'Caterwauler McCrae', - 'substr' => 'Cat' - }, - { - 'artistid' => '2', - 'name' => 'Random Boy Band', - 'substr' => 'Ran' - }, - { - 'artistid' => '3', - 'name' => 'We Are Goth', - 'substr' => 'We ' - } - ], 'display with substring okay'); + { + 'artistid' => 1, + 'cds' => [ + { + 'cdid' => 3, + 'artist' => 1, + 'title' => 'Caterwaulin\' Blues', + 'year' => '1997' + }, + { + 'cdid' => 1, + 'artist' => 1, + 'title' => 'Spoonful of bees', + 'year' => '1999' + }, + { + 'cdid' => 2, + 'artist' => 1, + 'title' => 'Forkful of bees', + 'year' => '2001' + } + ], + 'name' => 'Caterwauler McCrae', + 'substr' => 'Cat' + } + ], 'substring before prefetch okay'); } - - +done_testing();