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

AK+Format: Support default index in replacement field.

The following does now work:

    outf("{:0{}}", 1, 3);      // 001
This commit is contained in:
asynts 2020-09-28 11:44:24 +02:00 committed by Andreas Kling
parent afa2523724
commit 13ce24de13
3 changed files with 52 additions and 26 deletions

View file

@ -119,6 +119,7 @@ TEST_CASE(replacement_field)
EXPECT_EQ(String::formatted("{:*<{1}}", 7, 4), "7***");
EXPECT_EQ(String::formatted("{:{2}}", -5, 8, 16), " -5");
EXPECT_EQ(String::formatted("{{{:*^{1}}}}", 1, 3), "{*1*}");
EXPECT_EQ(String::formatted("{:0{}}", 1, 3), "001");
}
TEST_MAIN(Format)