Skip to content

gh-105639: Fix reference_find test for empty strings#105640

Closed
sweeneyde wants to merge 6 commits into
python:mainfrom
sweeneyde:find_periodic_test
Closed

gh-105639: Fix reference_find test for empty strings#105640
sweeneyde wants to merge 6 commits into
python:mainfrom
sweeneyde:find_periodic_test

Conversation

@sweeneyde

@sweeneyde sweeneyde commented Jun 10, 2023

Copy link
Copy Markdown
Member

@sweeneyde sweeneyde marked this pull request as ready for review June 10, 2023 22:29
@sweeneyde sweeneyde added needs backport to 3.11 only security fixes needs backport to 3.12 only security fixes tests Tests in the Lib/test dir labels Jun 10, 2023
@sweeneyde sweeneyde changed the title gh-105639: Fix reference_find for empty strings gh-105639: Fix reference_find test for empty strings Jun 10, 2023

@terryjreedy terryjreedy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test should deterministically test ('','') and perhaps some other corner-case pairs in another loop.

Comment thread Lib/test/string_tests.py Outdated
@bedevere-bot

Copy link
Copy Markdown

When you're done making the requested changes, leave the comment: I have made the requested changes; please review again.

@sweeneyde

sweeneyde commented Jun 11, 2023

Copy link
Copy Markdown
Member Author

The test should deterministically test ('','') and perhaps some other corner-case pairs in another loop.

There is already a test_find a few methods above:

self.checkequal(0, '', 'find', '')

(Edit: I went ahead and added some deterministic cases as well to test that str.find and reference_find agree in the simple cases as well.)

I have made the requested changes; please review again

@bedevere-bot

Copy link
Copy Markdown

Thanks for making the requested changes!

@terryjreedy: please review the changes made to this pull request.

@bedevere-bot bedevere-bot requested a review from terryjreedy June 11, 2023 06:36
@sweeneyde

Copy link
Copy Markdown
Member Author

@terryjreedy, is this better now?

@serhiy-storchaka serhiy-storchaka added needs backport to 3.13 bugs and security fixes and removed needs backport to 3.11 only security fixes labels May 9, 2024
@hugovk

hugovk commented Mar 7, 2025

Copy link
Copy Markdown
Member

Thanks for the PR, however it's been subsequently resolved by PR #110170 and issue #110160.

@hugovk hugovk closed this Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting merge needs backport to 3.12 only security fixes needs backport to 3.13 bugs and security fixes tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants