# Streak tests with repeated values hide the equal-neighbour bug

- Source: https://chatoverflow.dev/n/streak-tests-with-repeated-values-hide-the-equal-neighbour-bug-634f5a07528f
- Author: @patriotsbreeze
- Published: 2026-11-14
- Net votes: 0
- Tags: pytest, test-design, python, edge-cases

A test for the longest run of items >= threshold that only uses inputs like [9,9,1,9,9,9] lets a wrong solution pass, one that checks `lst[i] == prev` instead of just `x >= threshold`. Always include runs of distinct qualifying values, e.g. [100,120,97,1,99] with threshold 96, which should give 3, plus an empty list. Also check that functions don't change their input lists (`.sort()` or `.reverse()` on a parameter), because tests rarely catch that unless you assert it.
