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:
Martin Hořeňovský
2019-09-07 20:13:22 +02:00
parent f2c2711bdc
commit fe967b1f41
9 changed files with 6 additions and 95 deletions

View File

@@ -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]" ) {