AK: Allow setting both width and precision when formatting a string

This commit is contained in:
Timothy Flynn 2021-07-17 18:04:59 -04:00 committed by Gunnar Beutner
parent df5fa8aa39
commit 06ddfcde89
Notes: sideshowbarker 2024-07-18 22:57:59 +09:00
2 changed files with 3 additions and 2 deletions

View file

@ -125,6 +125,9 @@ TEST_CASE(complex_string_specifiers)
EXPECT_EQ(String::formatted("{:9}", "abcd"), "abcd ");
EXPECT_EQ(String::formatted("{:>9}", "abcd"), " abcd");
EXPECT_EQ(String::formatted("{:^9}", "abcd"), " abcd ");
EXPECT_EQ(String::formatted("{:4.6}", "a"), "a ");
EXPECT_EQ(String::formatted("{:4.6}", "abcdef"), "abcdef");
EXPECT_EQ(String::formatted("{:4.6}", "abcdefghi"), "abcdef");
}
TEST_CASE(cast_integer_to_character)