1 BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) }
11 my $schema = DBICTest->init_schema();
14 my $it = $schema->resultset("CD")->search( {},
18 is( $it->count, 3, "count ok" );
19 is( $it->next->title, "Caterwaulin' Blues", "iterator->next ok" );
22 is( $it->next, undef, "next past end of resultset ok" );
25 my @cds = $schema->resultset("CD")->search( {},
30 is( $cds[0]->title, "Spoonful of bees", "offset ok" );
32 # test software-based limiting
33 $it = $schema->resultset("CD")->search( {},
38 is( $it->count, 3, "software limit count ok" );
39 is( $it->next->title, "Caterwaulin' Blues", "software iterator->next ok" );
42 is( $it->next, undef, "software next past end of resultset ok" );
44 @cds = $schema->resultset("CD")->search( {},
50 is( $cds[0]->title, "Spoonful of bees", "software offset ok" );
53 $schema->resultset("CD")->search({}, {
57 } qr/Unable to generate limited query representation with 'software_limit' enabled/;
59 @cds = $schema->resultset("CD")->search( {},
64 is( $cds[0]->title, "Spoonful of bees", "offset with no limit" );
66 $it = $schema->resultset("CD")->search(
73 -not_like => 'Forkful%'
79 is( $it->count, 1, "complex abstract count ok" );