summaryrefslogtreecommitdiff
path: root/AK/Tests/TestFormat.cpp
diff options
context:
space:
mode:
authorasynts <asynts@gmail.com>2020-09-28 09:19:36 +0200
committerAndreas Kling <kling@serenityos.org>2020-09-28 10:53:16 +0200
commit6a2f5f45226fd3979fac7deedca8b61618f09749 (patch)
treed0984cd5b913f47bf8390276c2482f166559b041 /AK/Tests/TestFormat.cpp
parentebe1288aea962951f1b1f2c3a2796f69a8c13f68 (diff)
downloadserenity-6a2f5f45226fd3979fac7deedca8b61618f09749.zip
AK+Format: Clean up format specifier parsing using GenericLexer.
Also adds support for replacement fields.
Diffstat (limited to 'AK/Tests/TestFormat.cpp')
-rw-r--r--AK/Tests/TestFormat.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/AK/Tests/TestFormat.cpp b/AK/Tests/TestFormat.cpp
index da927de596..0336db2c0a 100644
--- a/AK/Tests/TestFormat.cpp
+++ b/AK/Tests/TestFormat.cpp
@@ -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)