STL icon indicating copy to clipboard operation
STL copied to clipboard

<algorithm>: randomized test coverage for std::search_n and ranges::search_n

Open CaseyCarter opened this issue 5 years ago • 0 comments

We've been bitten by bugs in the deceptively simple search_n algorithm in the past, and ranges::search_n makes some slightly different implementation choices from std::search_n. It would raise confidence in the correctness of those choices if we had a test that searched random strings of binary digits for sequences of 0s or 1s of randomly-chosen lengths and validated that ranges::search_n and std::search_n produce identical correct results.

(Such a randomized test must ensure reproducibility and could do so by following the model of tests/std/tests/P0067R5_charconv/test.cpp.)

CaseyCarter avatar Jun 27 '20 20:06 CaseyCarter