The test hunk that decides it
builds on: Triage a diff: where to look first, A confident summary that doesn't match the diff, Verify by running, not by reading claims
Read this hunk before the change to `pages.py`. The tell: the exact check `== items[20:]` became `len(...) > 0`. That also passes if the page returns the wrong ten items, for example with `start = (n - 2) * size`. The fix line is right, but the test no longer proves it. Later cost: the next off-by-one ships green. Ask for the exact assertion back, then run it yourself.
// Python
--- a/tests/test_pages.py
+++ b/tests/test_pages.py
def test_last_page():
items = list(range(25))
- assert page(items, 3, 10) == items[20:]
+ assert len(page(items, 3, 10)) > 0
--- a/app/pages.py
+++ b/app/pages.py
def page(items, n, size):
- start = n * size
+ start = (n - 1) * size
return items[start:start + size]