Step 1 of 6
Review: pagination
Reading other people's code critically is half of a professional developer's job. In a code review, ask of every line: what inputs break this? Empty input, the first and last item, zero, negative numbers, huge numbers.
A teammate opened this pull request for the leaderboard API. The spec says:
pageis 1-based (page 1 is the first page)- pages past the end return an empty list, never crash
page < 1orper_page < 1returns an empty list
The tests here are the reviewer's edge cases. Your turn: find and fix the bugs. There are three.