X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F750firebird.t;fp=t%2F750firebird.t;h=55ed07507e8abc7c551e3dd2b447104944264b56;hb=17d59d97920c4698228ef4e21bfd76214f7a33d5;hp=a1f980728c4b4638d8a51394582070551484bfa2;hpb=c58270743fa0bebf1410d02136b3f82ec8838feb;p=dbsrgits%2FDBIx-Class.git diff --git a/t/750firebird.t b/t/750firebird.t index a1f9807..55ed075 100644 --- a/t/750firebird.t +++ b/t/750firebird.t @@ -116,18 +116,17 @@ EOF for (1..2) { push @pop, { name => "Artist_expkey_$_", artistid => 100 + $_ }; } - # XXX why does insert_bulk not work here? - my @foo = $ars->populate (\@pop); + $ars->populate (\@pop); }); # count what we did so far is ($ars->count, 6, 'Simple count works'); # test UPDATE - lives_ok { - $schema->resultset('Artist') - ->search({name => 'foo'}) - ->update({rank => 4 }); + lives_and { + $ars->search({ name => 'foo' })->update({ rank => 4 }); + + is $ars->search({ name => 'foo' })->first->rank, 4; } 'Can update a column'; my ($updated) = $schema->resultset('Artist')->search({name => 'foo'}); @@ -151,6 +150,15 @@ EOF is( $lim->next->artistid, 102, "iterator->next ok" ); is( $lim->next, undef, "next past end of resultset ok" ); +# test multiple executing cursors + { + my $rs1 = $ars->search({}, { order_by => { -asc => 'artistid' }}); + my $rs2 = $ars->search({}, { order_by => { -desc => 'artistid' }}); + + is $rs1->first->artistid, 1, 'multiple cursors'; + is $rs2->first->artistid, 102, 'multiple cursors'; + } + # test empty insert { local $ars->result_source->column_info('artistid')->{is_auto_increment} = 0;