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 |
Author
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.