Revamp sf::String tests#3418
Merged
Merged
Conversation
Member
Author
|
Attn: @FRex |
kimci86
reviewed
Feb 4, 2025
ea6df26 to
f272dda
Compare
eXpl0it3r
approved these changes
Feb 5, 2025
eXpl0it3r
left a comment
Member
There was a problem hiding this comment.
I feel like select is quite a non-speaking name. I had to scroll up and read the comment just to understand what the what's supposed to do.
Member
Author
There's definitely room for improvement here. I'm open to suggestions. I can't think of a good name off the top of my head. |
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.
Description
Related to #3406
I wrote the
sf::Stringtests (see #2466) with no knowledge of how Unicode works, therefore the tests did a poor job actually testing all the Unicode-aware features of the class. I rewrote most of the tests to use Unicode codepoints more often. These new tests will do a much better job catching regressions.In this same PR I also included a separate commit that removes hex code from strings in favor of the actual Unicode characters those hex values correspond to. Nobody would know that
\U0001F40Dmeans the 🐌 emoji. I know that because\U0001F40Dis actually 🐍! The snail is\U0001F40C. Aren't you glad you can just see the character with your own eyes without having to check the web while reading the tests? Adding these characters required adding the/utf-8code to MSVC builds.These tests mostly exercise happy path code. There are many more tests we could theoretically add with error cases and non-default
std::localevalues but I chose to hold off on those for now.