diff options
author | asynts <asynts@gmail.com> | 2020-09-28 11:44:24 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-09-28 17:41:27 +0200 |
commit | 13ce24de135805c250ca64e32b8f911004073a69 (patch) | |
tree | bf26b374c828b31f0ec0a3f8ecb2461921cd838c /AK/Tests | |
parent | afa2523724c1b8435a0df1ef5acfe112ae5e6318 (diff) | |
download | serenity-13ce24de135805c250ca64e32b8f911004073a69.zip |
AK+Format: Support default index in replacement field.
The following does now work:
outf("{:0{}}", 1, 3); // 001
Diffstat (limited to 'AK/Tests')
-rw-r--r-- | AK/Tests/TestFormat.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/AK/Tests/TestFormat.cpp b/AK/Tests/TestFormat.cpp index 86227f8e16..898fd49df0 100644 --- a/AK/Tests/TestFormat.cpp +++ b/AK/Tests/TestFormat.cpp @@ -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) |