[guest - Fri Aug 15 15:41:05 2003]:
Show quoted text> When using the latest version of Data::Page (0.18), "make test" fails
> on tests of "splice", e.g.:
>
> # Failed test (t/main.t at line 77)
> # got: '20,21,22,23'
> # expected: '20,21,22'
>
> ky
OK, so the "splice" method in Data::Page definitely changed in 0.18, and it's definitely
returning different numbers than the "splice" tests are expecting -- basically one fewer.
The failures of the tests actually are a bit confusing as the first two arguments to "is"
should be reversed, like so:
is($page->first_page, $vals[4], "$name: first page");
is($page->last_page, $vals[5], "$name: last page");
is($page->first, $vals[6], "$name: first");
is($page->last, $vals[7], "$name: last");
is($page->previous_page, $vals[8], "$name: previous_page");
is($page->current_page, $vals[9], "$name: current_page");
is($page->next_page, $vals[10], "$name: next_page");
is($integers, $vals[11], "$name: splice");
is($page->next_set(), $vals[12], "$name: next_set");
is($page->previous_set(), $vals[13], "$name: previous_set");
is($page_nums, $vals[14], "$name: pages_in_set");
Then at least you can see this better:
not ok 80 - Under 10: splice
# Failed test (t/main.t at line 77)
# got: '0,1'
# expected: '0,1,2'
Comparing your test with that in Data::Page (both 0.17 and 0.18), I see that you
basically cloned their tests for your own, and their tests show one fewer number for
"splice" b/w those two versions. I guess they found a bug in the earlier implementation,
but no mention is made of it in the "Changes" file.
ky