1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 09:18:11 +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

@ -7,8 +7,8 @@
#include <LibTest/TestCase.h>
#include <AK/DeprecatedString.h>
#include <AK/Optional.h>
#include <AK/String.h>
#include <AK/Vector.h>
TEST_CASE(basic_optional)
@ -59,7 +59,7 @@ TEST_CASE(optional_rvalue_ref_qualified_getters)
TEST_CASE(optional_leak_1)
{
struct Structure {
Optional<String> str;
Optional<DeprecatedString> str;
};
// This used to leak, it does not anymore.
@ -81,7 +81,7 @@ TEST_CASE(comparison_without_values)
{
Optional<StringView> opt0;
Optional<StringView> opt1;
Optional<String> opt2;
Optional<DeprecatedString> opt2;
EXPECT_EQ(opt0, opt1);
EXPECT_EQ(opt0, opt2);
}
@ -90,7 +90,7 @@ TEST_CASE(comparison_with_values)
{
Optional<StringView> opt0;
Optional<StringView> opt1 = "foo"sv;
Optional<String> opt2 = "foo"sv;
Optional<DeprecatedString> opt2 = "foo"sv;
Optional<StringView> opt3 = "bar"sv;
EXPECT_NE(opt0, opt1);
EXPECT_EQ(opt1, opt2);
@ -99,14 +99,14 @@ TEST_CASE(comparison_with_values)
TEST_CASE(comparison_to_underlying_types)
{
Optional<String> opt0;
EXPECT_NE(opt0, String());
Optional<DeprecatedString> opt0;
EXPECT_NE(opt0, DeprecatedString());
EXPECT_NE(opt0, "foo");
Optional<StringView> opt1 = "foo"sv;
EXPECT_EQ(opt1, "foo");
EXPECT_NE(opt1, "bar");
EXPECT_EQ(opt1, String("foo"));
EXPECT_EQ(opt1, DeprecatedString("foo"));
}
TEST_CASE(comparison_with_numeric_types)
@ -262,7 +262,7 @@ TEST_CASE(comparison_reference)
StringView test = "foo"sv;
Optional<StringView&> opt0;
Optional<StringView const&> opt1 = test;
Optional<String> opt2 = "foo"sv;
Optional<DeprecatedString> opt2 = "foo"sv;
Optional<StringView> opt3 = "bar"sv;
EXPECT_NE(opt0, opt1);