Here are some tests I generalized (untested) from our test suite (they
may or may not be helpful):
diag("With existing data, and a resultset already using slice (within
the existing rows)");
ok(
my $rs_format_slice_within =
$schema->resultset('Format')->search()->slice(4, 6), #3 rows
"Searched for all formats, using a slice that matches",
);
is($rs_format_slice_within->count(), 3, " and found some using count");
diag("With existing data, and a resultset already using slice (outside
the existing rows)");
ok(
my $rs_format_slice_outside =
$schema->resultset('Format')->search()->slice(1000, 1002),
#0 rows
"Searched for all formats, using a slice that's out of bounds",
);
is($rs_format_slice_outside->count(), 0, " and found none using count");