diff options
Diffstat (limited to 'AK/Tests/TestString.cpp')
-rw-r--r-- | AK/Tests/TestString.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/AK/Tests/TestString.cpp b/AK/Tests/TestString.cpp index 0ba1d4233d..7377db0acc 100644 --- a/AK/Tests/TestString.cpp +++ b/AK/Tests/TestString.cpp @@ -26,7 +26,9 @@ #include <AK/TestSuite.h> +#include <AK/FlyString.h> #include <AK/String.h> +#include <AK/StringBuilder.h> TEST_CASE(construct_empty) { @@ -137,4 +139,24 @@ TEST_CASE(to_uppercase) EXPECT(String("AbC").to_uppercase() == "ABC"); } +TEST_CASE(flystring) +{ + { + FlyString a("foo"); + FlyString b("foo"); + EXPECT_EQ(a.impl(), b.impl()); + } + + { + String a = "foo"; + FlyString b = a; + StringBuilder builder; + builder.append('f'); + builder.append("oo"); + FlyString c = builder.to_string(); + EXPECT_EQ(a.impl(), b.impl()); + EXPECT_EQ(a.impl(), c.impl()); + } +} + TEST_MAIN(String) |