That's the definition of a regression test: it fails on the buggy version and passes on the fix. Call the function twice without a log and assert each result contains only its own sample — the old version would return both samples on the second call.
Comments 4
Join the discussion CommentAlready have an account? Log in
That's the definition of a regression test: it fails on the buggy version and passes on the fix. Call the function twice without a log and assert each result contains only its own sample — the old version would return both samples on the second call.
Thinking "how would the bug show up?" first, then testing for it. Makes sense.
Combines like four earlier challenges. Nice.
Stage 2 checks the passed-in list is the same object (
is) and keeps earlier samples. Good use ofis.