mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:37:43 +00:00
AK+Everywhere: Rename String to DeprecatedString
We have a new, improved string type coming up in AK (OOM aware, no null state), and while it's going to use UTF-8, the name UTF8String is a mouthful - so let's free up the String name by renaming the existing class. Making the old one have an annoying name will hopefully also help with quick adoption :^)
This commit is contained in:
parent
f74251606d
commit
6e19ab2bbc
2006 changed files with 11635 additions and 11636 deletions
|
@ -49,20 +49,20 @@ TEST_CASE(array_doubles)
|
|||
|
||||
TEST_CASE(vector_strings)
|
||||
{
|
||||
Vector<String> strings;
|
||||
Vector<DeprecatedString> strings;
|
||||
strings.append("bat");
|
||||
strings.append("cat");
|
||||
strings.append("dog");
|
||||
|
||||
auto string_compare = [](String const& a, String const& b) -> int {
|
||||
auto string_compare = [](DeprecatedString const& a, DeprecatedString const& b) -> int {
|
||||
return strcmp(a.characters(), b.characters());
|
||||
};
|
||||
auto test1 = *binary_search(strings, String("bat"), nullptr, string_compare);
|
||||
auto test2 = *binary_search(strings, String("cat"), nullptr, string_compare);
|
||||
auto test3 = *binary_search(strings, String("dog"), nullptr, string_compare);
|
||||
EXPECT_EQ(test1, String("bat"));
|
||||
EXPECT_EQ(test2, String("cat"));
|
||||
EXPECT_EQ(test3, String("dog"));
|
||||
auto test1 = *binary_search(strings, DeprecatedString("bat"), nullptr, string_compare);
|
||||
auto test2 = *binary_search(strings, DeprecatedString("cat"), nullptr, string_compare);
|
||||
auto test3 = *binary_search(strings, DeprecatedString("dog"), nullptr, string_compare);
|
||||
EXPECT_EQ(test1, DeprecatedString("bat"));
|
||||
EXPECT_EQ(test2, DeprecatedString("cat"));
|
||||
EXPECT_EQ(test3, DeprecatedString("dog"));
|
||||
}
|
||||
|
||||
TEST_CASE(single_element)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue