1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 12:27:36 +00:00

AK: Make "foo"_fly_string infallible

Stop worrying about tiny OOMs.

Work towards #20405.
This commit is contained in:
Andreas Kling 2023-08-07 12:07:35 +02:00
parent 34344120f2
commit 25eee91811
30 changed files with 59 additions and 72 deletions

View file

@ -68,15 +68,15 @@ TEST_CASE(long_string)
TEST_CASE(from_string_view)
{
auto fly1 = MUST("thisisdefinitelymorethan7bytes"_fly_string);
auto fly1 = "thisisdefinitelymorethan7bytes"_fly_string;
EXPECT_EQ(fly1, "thisisdefinitelymorethan7bytes"sv);
EXPECT_EQ(FlyString::number_of_fly_strings(), 1u);
auto fly2 = MUST("thisisdefinitelymorethan7bytes"_fly_string);
auto fly2 = "thisisdefinitelymorethan7bytes"_fly_string;
EXPECT_EQ(fly2, "thisisdefinitelymorethan7bytes"sv);
EXPECT_EQ(FlyString::number_of_fly_strings(), 1u);
auto fly3 = MUST("foo"_fly_string);
auto fly3 = "foo"_fly_string;
EXPECT_EQ(fly3, "foo"sv);
EXPECT_EQ(FlyString::number_of_fly_strings(), 1u);