--- trunk/t/pgest.t 2005/05/26 00:05:33 13 +++ trunk/t/pgest.t 2005/05/26 00:06:10 14 @@ -2,7 +2,7 @@ use strict; -use Test::More tests => 49; +use Test::More tests => 67; BEGIN { use_ok('DBI'); @@ -95,3 +95,13 @@ cmp_ok($hits, '==', pgest('blade runner', '', 0, undef), "null offset"); cmp_ok($hits, '==', pgest('blade runner', undef, undef, undef), "null optional"); +# test limit, offset and global mess +my $d = int($hits / 3); +cmp_ok($d, '==', pgest('blade runner',undef, $d, undef), "limit $d"); +cmp_ok($hits, '==', pgest('blade runner', undef, undef, undef), "check"); + +cmp_ok(($hits - $d), '==', pgest('blade runner',undef, undef, $d), "offset $d"); +cmp_ok($hits, '==', pgest('blade runner', undef, undef, undef), "check"); + +cmp_ok(($hits - $d - $d), '==', pgest('blade runner',undef, ($hits - $d), $d), "limit $d offset $d"); +cmp_ok($hits, '==', pgest('blade runner', undef, undef, undef), "check");