X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F76joins.t;h=0fc9f53196f953ab240490d3bcaec7953158c806;hb=5db49b9aee9a586a76b37fd950bb9bc22bd5e985;hp=069626aff869edf2232b7fecf0ba0bc12de08ae3;hpb=ae51573612aec70814b81bfe0c3683b824564368;p=dbsrgits%2FDBIx-Class.git diff --git a/t/76joins.t b/t/76joins.t index 069626a..0fc9f53 100644 --- a/t/76joins.t +++ b/t/76joins.t @@ -5,7 +5,7 @@ use Test::More; use lib qw(t/lib); use DBICTest; -my $schema = DBICTest::init_schema(); +my $schema = DBICTest->init_schema(); use IO::File; @@ -13,7 +13,7 @@ BEGIN { eval "use DBD::SQLite"; plan $@ ? ( skip_all => 'needs DBD::SQLite for testing' ) - : ( tests => 42 ); + : ( tests => 43 ); } # figure out if we've got a version of sqlite that is older than 3.2.6, in @@ -70,6 +70,22 @@ $match = 'person child INNER JOIN person father ON ( father.person_id = ' is( $sa->_recurse_from(@j3), $match, 'join 3 (inner join) ok'); +my @j4 = ( + { mother => 'person' }, + [ [ { child => 'person', -join_type => 'left' }, + [ { father => 'person', -join_type => 'right' }, + { 'father.person_id' => 'child.father_id' } + ] + ], + { 'mother.person_id' => 'child.mother_id' } + ], +); +$match = 'person mother LEFT JOIN (person child RIGHT JOIN person father ON (' + . ' father.person_id = child.father_id )) ON ( mother.person_id = ' + . 'child.mother_id )' + ; +is( $sa->_recurse_from(@j4), $match, 'join 4 (nested joins + join types) ok'); + my $rs = $schema->resultset("CD")->search( { 'year' => 2001, 'artist.name' => 'Caterwauler McCrae' }, { from => [ { 'me' => 'cd' },