X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F72pg.t;h=a981fc813526ac6f2dfb85d478e1d022b17e3246;hb=9727774577b1cbf4d0a3c5eb2def2c19a2ba0b17;hp=162c276245eee96bf5977d794c58865729308dd8;hpb=93d0eb5e68df665327ddb12a64939dc3de2c0ec6;p=dbsrgits%2FDBIx-Class.git diff --git a/t/72pg.t b/t/72pg.t index 162c276..a981fc8 100644 --- a/t/72pg.t +++ b/t/72pg.t @@ -53,6 +53,27 @@ DBICTest::Schema->load_classes( map {s/.+:://;$_} @test_classes ) if @test_class ok (!$s->storage->_dbh, 'still not connected'); } +# test LIMIT support +{ + my $schema = DBICTest::Schema->connect($dsn, $user, $pass); + drop_test_schema($schema); + create_test_schema($schema); + for (1..6) { + $schema->resultset('Artist')->create({ name => 'Artist ' . $_ }); + } + my $it = $schema->resultset('Artist')->search( {}, + { rows => 3, + offset => 2, + order_by => 'artistid' } + ); + is( $it->count, 3, "LIMIT count ok" ); # ask for 3 rows out of 6 artists + is( $it->next->name, "Artist 3", "iterator->next ok" ); + $it->next; + $it->next; + $it->next; + is( $it->next, undef, "next past end of resultset ok" ); +} + # check if we indeed do support stuff my $test_server_supports_insert_returning = do { my $v = DBICTest::Schema->connect($dsn, $user, $pass)