8 my $schema = DBICTest->init_schema();
11 eval "use DBD::SQLite";
12 plan $@ ? (skip_all => 'needs DBD::SQLite for testing') : (tests => 10);
16 my $it = $schema->resultset("CD")->search( {},
20 is( $it->count, 3, "count ok" );
21 is( $it->next->title, "Caterwaulin' Blues", "iterator->next ok" );
24 is( $it->next, undef, "next past end of resultset ok" );
27 my @cds = $schema->resultset("CD")->search( {},
32 is( $cds[0]->title, "Spoonful of bees", "offset ok" );
34 # test software-based limiting
35 $it = $schema->resultset("CD")->search( {},
40 is( $it->count, 3, "software limit count ok" );
41 is( $it->next->title, "Caterwaulin' Blues", "software iterator->next ok" );
44 is( $it->next, undef, "software next past end of resultset ok" );
46 @cds = $schema->resultset("CD")->search( {},
52 is( $cds[0]->title, "Spoonful of bees", "software offset ok" );
55 @cds = $schema->resultset("CD")->search( {},
60 is( $cds[0]->title, "Spoonful of bees", "offset with no limit" );
63 # based on a failing criteria submitted by waswas
64 # requires SQL::Abstract >= 1.20
65 $it = $schema->resultset("CD")->search(
72 -not_like => 'Forkful%'
78 is( $it->count, 1, "complex abstract count ok" );