1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:38:11 +00:00

AK+Format: Clean up format specifier parsing using GenericLexer.

Also adds support for replacement fields.
This commit is contained in:
asynts 2020-09-28 09:19:36 +02:00 committed by Andreas Kling
parent ebe1288aea
commit 6a2f5f4522
3 changed files with 165 additions and 134 deletions

View file

@ -113,4 +113,9 @@ TEST_CASE(zero_pad)
EXPECT_EQ(String::formatted("{:/^010}", 42), "////42////");
}
TEST_CASE(replacement_field)
{
EXPECT_EQ(String::formatted("{:*>{1}}", 13, static_cast<size_t>(10)), "********13");
}
TEST_MAIN(Format)