mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 05:09:12 +00:00
AK: Make "foo"_fly_string infallible
Stop worrying about tiny OOMs. Work towards #20405.
This commit is contained in:
parent
34344120f2
commit
25eee91811
Notes:
sideshowbarker
2024-07-17 05:23:40 +09:00
Author: https://github.com/awesomekling
Commit: 25eee91811
Pull-request: https://github.com/SerenityOS/serenity/pull/20408
30 changed files with 59 additions and 72 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue