From: Matt S Trout Date: Wed, 11 Jan 2006 20:18:19 +0000 (+0000) Subject: Extra test from Will Hawes X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8fe164b96448150c798e5f6281fed06207a17536;p=dbsrgits%2FDBIx-Class-Historic.git Extra test from Will Hawes --- diff --git a/lib/DBIx/Class.pm b/lib/DBIx/Class.pm index ef56fb6..7e19c05 100644 --- a/lib/DBIx/Class.pm +++ b/lib/DBIx/Class.pm @@ -129,6 +129,8 @@ Jess Robinson Marcus Ramberg +Will Hawes + =head1 LICENSE You may distribute this code under the same terms as Perl itself. diff --git a/t/run/16joins.tl b/t/run/16joins.tl index e9aabc9..20a6214 100644 --- a/t/run/16joins.tl +++ b/t/run/16joins.tl @@ -6,7 +6,7 @@ BEGIN { eval "use DBD::SQLite"; plan $@ ? ( skip_all => 'needs DBD::SQLite for testing' ) - : ( tests => 22 ); + : ( tests => 23 ); } # test the abstract join => SQL generator @@ -81,6 +81,13 @@ cmp_ok( $rs->count, '==', 1, "Single record in resultset"); is($rs->first->title, 'Come Be Depressed With Us', 'Correct record returned'); +# when using join attribute, make sure slice()ing all objects has same count as all() +$rs = DBICTest->class("CD")->search( + { 'artist' => 1 }, + { join => [qw/artist/], order_by => 'artist.name' } +); +cmp_ok( scalar $rs->all, '==', scalar $rs->slice(0, $rs->count - 1), 'slice() with join has same count as all()' ); + $rs = DBICTest->class("Artist")->search( { 'liner_notes.notes' => 'Kill Yourself!' }, { join => { 'cds' => 'liner_notes' } });