1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:17:36 +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:
Linus Groh 2022-12-04 18:02:33 +00:00 committed by Andreas Kling
parent f74251606d
commit 6e19ab2bbc
2006 changed files with 11635 additions and 11636 deletions

View file

@ -121,7 +121,7 @@ TEST_CASE(regex_lexer)
TEST_CASE(parser_error_parens)
{
String pattern = "test()test";
DeprecatedString pattern = "test()test";
Lexer l(pattern);
PosixExtendedParser p(l);
p.parse();
@ -131,7 +131,7 @@ TEST_CASE(parser_error_parens)
TEST_CASE(parser_error_special_characters_used_at_wrong_place)
{
String pattern;
DeprecatedString pattern;
Vector<char, 5> chars = { '*', '+', '?', '{' };
StringBuilder b;
@ -266,7 +266,7 @@ TEST_CASE(catch_all_newline)
Regex<PosixExtended> re("^.*$", PosixFlags::Multiline | PosixFlags::StringCopyMatches);
RegexResult result;
auto lambda = [&result, &re]() {
String aaa = "Hello World\nTest\n1234\n";
DeprecatedString aaa = "Hello World\nTest\n1234\n";
result = match(aaa, re);
EXPECT_EQ(result.success, true);
};
@ -282,11 +282,11 @@ TEST_CASE(catch_all_newline_view)
Regex<PosixExtended> re("^.*$", PosixFlags::Multiline);
RegexResult result;
String aaa = "Hello World\nTest\n1234\n";
DeprecatedString aaa = "Hello World\nTest\n1234\n";
result = match(aaa, re);
EXPECT_EQ(result.success, true);
EXPECT_EQ(result.count, 3u);
String str = "Hello World";
DeprecatedString str = "Hello World";
EXPECT_EQ(result.matches.at(0).view, str.view());
EXPECT_EQ(result.matches.at(1).view, "Test");
EXPECT_EQ(result.matches.at(2).view, "1234");
@ -312,7 +312,7 @@ TEST_CASE(catch_all_newline_2)
TEST_CASE(match_all_character_class)
{
Regex<PosixExtended> re("[[:alpha:]]");
String str = "[Window]\nOpacity=255\nAudibleBeep=0\n";
DeprecatedString str = "[Window]\nOpacity=255\nAudibleBeep=0\n";
RegexResult result = match(str, re, PosixFlags::Global | PosixFlags::StringCopyMatches);
EXPECT_EQ(result.success, true);
@ -325,7 +325,7 @@ TEST_CASE(match_all_character_class)
TEST_CASE(match_character_class_with_assertion)
{
Regex<PosixExtended> re("[[:alpha:]]+$");
String str = "abcdef";
DeprecatedString str = "abcdef";
RegexResult result = match(str, re);
EXPECT_EQ(result.success, true);
@ -371,7 +371,7 @@ TEST_CASE(ini_file_entries)
regex_dbg.print_bytecode(re);
}
String haystack = "[Window]\nOpacity=255\nAudibleBeep=0\n";
DeprecatedString haystack = "[Window]\nOpacity=255\nAudibleBeep=0\n";
EXPECT_EQ(re.search(haystack.view(), result, PosixFlags::Multiline), true);
EXPECT_EQ(result.count, 3u);
@ -399,7 +399,7 @@ TEST_CASE(ini_file_entries2)
Regex<PosixExtended> re("[[:alpha:]]*=([[:digit:]]*)");
RegexResult result;
String haystack = "ViewMode=Icon";
DeprecatedString haystack = "ViewMode=Icon";
EXPECT_EQ(re.match(haystack.view(), result), false);
EXPECT_EQ(result.count, 0u);
@ -420,7 +420,7 @@ TEST_CASE(named_capture_group)
regex_dbg.print_bytecode(re);
}
String haystack = "[Window]\nOpacity=255\nAudibleBeep=0\n";
DeprecatedString haystack = "[Window]\nOpacity=255\nAudibleBeep=0\n";
EXPECT_EQ(re.search(haystack, result, PosixFlags::Multiline), true);
EXPECT_EQ(result.count, 2u);
EXPECT_EQ(result.matches.at(0).view, "Opacity=255");
@ -443,7 +443,7 @@ TEST_CASE(ecma262_named_capture_group_with_dollar_sign)
regex_dbg.print_bytecode(re);
}
String haystack = "[Window]\nOpacity=255\nAudibleBeep=0\n";
DeprecatedString haystack = "[Window]\nOpacity=255\nAudibleBeep=0\n";
EXPECT_EQ(re.search(haystack, result, ECMAScriptFlags::Multiline), true);
EXPECT_EQ(result.count, 2u);
EXPECT_EQ(result.matches.at(0).view, "Opacity=255");
@ -466,7 +466,7 @@ TEST_CASE(a_star)
regex_dbg.print_bytecode(re);
}
String haystack = "[Window]\nOpacity=255\nAudibleBeep=0\n";
DeprecatedString haystack = "[Window]\nOpacity=255\nAudibleBeep=0\n";
EXPECT_EQ(re.search(haystack.view(), result, PosixFlags::Multiline), true);
EXPECT_EQ(result.count, 32u);
if (result.count == 32u) {
@ -499,7 +499,7 @@ TEST_CASE(posix_extended_nested_capture_group)
EXPECT_EQ(result.capture_group_matches[0][2].view, "llo"sv);
}
auto parse_test_case_long_disjunction_chain = String::repeated("a|"sv, 100000);
auto parse_test_case_long_disjunction_chain = DeprecatedString::repeated("a|"sv, 100000);
TEST_CASE(ECMA262_parse)
{
@ -931,7 +931,7 @@ TEST_CASE(case_insensitive_match)
TEST_CASE(extremely_long_fork_chain)
{
Regex<ECMA262> re("(?:aa)*");
auto result = re.match(String::repeated('a', 1000));
auto result = re.match(DeprecatedString::repeated('a', 1000));
EXPECT_EQ(result.success, true);
}
@ -950,7 +950,7 @@ TEST_CASE(theoretically_infinite_loop)
}
}
static auto g_lots_of_a_s = String::repeated('a', 10'000'000);
static auto g_lots_of_a_s = DeprecatedString::repeated('a', 10'000'000);
BENCHMARK_CASE(fork_performance)
{