X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F100populate.t;h=fa07ba5595ec0a55914adc6da25171fd75aa86d4;hb=13ad6d2a9f92ee1fd3baf4921643901055b26b62;hp=57efc7232de648167d252099164e1e95da70ae01;hpb=0a768c9067712d4f9512748c315c617367fe8dc4;p=dbsrgits%2FDBIx-Class.git diff --git a/t/100populate.t b/t/100populate.t index 57efc72..fa07ba5 100644 --- a/t/100populate.t +++ b/t/100populate.t @@ -98,7 +98,7 @@ is(scalar @links, 2); is($links[0]->url, undef); is($links[1]->url, 'url42'); -## make sure populate -> insert_bulk honors fields/orders in void context +## make sure populate -> _insert_bulk honors fields/orders in void context ## schema order $schema->populate('Link', [ [ qw/id url title/ ], @@ -191,7 +191,7 @@ is($links[2]->title, undef); my $rs = $schema->resultset('Link'); $rs->delete; - # test insert_bulk with all literal sql (no binds) + # test populate with all literal sql (no binds) $rs->populate([ (+{ @@ -229,7 +229,7 @@ is($links[2]->title, undef); my $rs = $schema->resultset('Link'); $rs->delete; - # test insert_bulk with all literal/bind sql + # test populate with all literal/bind sql $rs->populate([ (+{ url => \['?', [ {} => 'cpan.org' ] ], @@ -244,7 +244,7 @@ is($links[2]->title, undef); $rs->delete; - # test insert_bulk with mix literal and literal/bind + # test populate with mix literal and literal/bind $rs->populate([ (+{ url => \"'cpan.org'", @@ -383,6 +383,7 @@ lives_ok { } 'literal+bind with semantically identical attrs works after normalization'; # test all kinds of population with stringified objects +# or with empty sets warnings_like { local $ENV{DBIC_RT79576_NOWARN}; @@ -438,10 +439,15 @@ warnings_like { [qw( rank name )], [ $rank, $fn ], ]}, + + 'empty set' => { AoA => [ + [qw( name rank )], + ]}, }; # generate the AoH equivalent based on the AoAs above for my $bag (values %$args) { + $bag->{AoH} = []; my @hdr = @{$bag->{AoA}[0]}; for my $v ( @{$bag->{AoA}}[1..$#{$bag->{AoA}}] ) { push @{$bag->{AoH}}, my $h = {};