Skip to content

update string_tests and solve failing test #4772

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 27, 2023

Conversation

sapsalian
Copy link
Contributor

I update string_tests.py from python 3.11.2. And then I found that the test case in string_tests was failing because rustpython returns b'' when executing the statement b''.replace('', 'A', 100), whereas cpython returns b'A'.
After investigating, I discovered that there was no handling for cases where both the self and the first argument are empty strings, so I fixed it.

@youknowone
Copy link
Member

Could you also check test_unicode? string_tests is not a test endpoint but a shared test library from test_unicode, test_bytes and test_userstring

@youknowone

This comment was marked as resolved.

@youknowone youknowone added A-stdlib z-ca-2023 Tag to track contrubution-academy 2023 labels Mar 26, 2023
@sapsalian
Copy link
Contributor Author

thank you for your review! I included test_unicode!

@fanninpm
Copy link
Contributor

Does test_bytes.py import string_tests.py?

Copy link
Member

@youknowone youknowone left a comment

Choose a reason for hiding this comment

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

Looks good, thank you!

@youknowone
Copy link
Member

@fanninpm test_bytes is already updated by other PR

@youknowone youknowone merged commit bdf5434 into RustPython:main Mar 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-stdlib z-ca-2023 Tag to track contrubution-academy 2023
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants