mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-01 21:05:39 +02:00
Remove the ill-considered StringRef::numberOfCharacters
It never counted characters, only codepoints. If you think these are interchangeable, you should not touch non-ascii text.
This commit is contained in:
@@ -159,18 +159,6 @@ TEST_CASE( "StringRef", "[Strings][StringRef]" ) {
|
||||
REQUIRE( stdStr.size() == sr.size() );
|
||||
}
|
||||
}
|
||||
|
||||
SECTION( "Counting utf-8 codepoints" ) {
|
||||
StringRef ascii = "just a plain old boring ascii string...";
|
||||
REQUIRE(ascii.numberOfCharacters() == ascii.size());
|
||||
|
||||
StringRef simpleu8 = u8"Trocha češtiny nikoho nezabila";
|
||||
REQUIRE(simpleu8.numberOfCharacters() == 30);
|
||||
|
||||
StringRef emojis = u8"Here be 👾";
|
||||
REQUIRE(emojis.numberOfCharacters() == 9);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
TEST_CASE( "replaceInPlace", "[Strings][StringManip]" ) {
|
||||
|
Reference in New Issue
Block a user