Repository navigation
Conversation
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
|
No NEWS entry needed here: the guide lists "test changes" as exempt in "Changes that require NEWS entries" (devguide, pull-request-lifecycle). This PR only adds a test. |
|
The ASan job fails in That is the same assertion and the same line as gh-160334, which records it as an ASan-only flake: since gh-154194 the profiler degrades a frame it cannot read to This PR only adds coverage in |
Adds a test beside
test_findinLib/test/test_str.pythat drives theadaptive search path with non-BMP characters.
Objects/stringlib/fastsearch.hcompilesadaptive_findonce per characterwidth, and only the ASCII and UCS1 copies ran under the whole suite:
The adaptive branch needs a haystack of at least 2500 characters, a needle of at
least 100, and a needle at least a third of the haystack.
test_adaptive_findmeets all three with
'a'and'b', so the UCS4 instantiation stayed cold.The new test repeats that shape with
'\U0001d11e'and'\U0001d11f', checkingboth a miss and a hit, through
findandcount. With it,ucs4lib_adaptive_findgoes from 0.00% to 89.74% of 39 lines; the branches leftare the count and reverse-search modes, which are separate entry points and are
covered elsewhere.
Test-only change, no behaviour change, so no NEWS entry.
./python -m test test_str -m "*adaptive*"passes. The new test adds about0.85 s to
test_stron a-O0 --coveragebuild, which is slower than a normalone; the whole module runs in roughly 14 s there.