diff options
author | Ali Mohammad Pur <ali.mpfard@gmail.com> | 2021-06-01 23:05:27 +0430 |
---|---|---|
committer | Ali Mohammad Pur <Ali.mpfard@gmail.com> | 2021-06-01 23:12:17 +0430 |
commit | 944855ca185f4d6a1587c174752446752775e040 (patch) | |
tree | 18984460dcaafeddbf9698a239939a43fa8e171d /Tests | |
parent | c0d1a7588153d35f06a9ff5d009261099e6fc647 (diff) | |
download | serenity-944855ca185f4d6a1587c174752446752775e040.zip |
AK+Everywhere: Fix compiletime format parsing of replacement fields
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/AK/TestFormat.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Tests/AK/TestFormat.cpp b/Tests/AK/TestFormat.cpp index 237d1a4354..266185a9d9 100644 --- a/Tests/AK/TestFormat.cpp +++ b/Tests/AK/TestFormat.cpp @@ -105,12 +105,12 @@ TEST_CASE(zero_pad) TEST_CASE(replacement_field) { - // FIXME: Compiletime check bypass: cannot parse '}}' correctly. - EXPECT_EQ(String::formatted(StringView { "{:*>{1}}" }, 13, static_cast<size_t>(10)), "********13"); - EXPECT_EQ(String::formatted(StringView { "{:*<{1}}" }, 7, 4), "7***"); + EXPECT_EQ(String::formatted("{:*>{1}}", 13, static_cast<size_t>(10)), "********13"); + EXPECT_EQ(String::formatted("{:*<{1}}", 7, 4), "7***"); + // Compiletime check bypass: intentionally ignoring extra arguments EXPECT_EQ(String::formatted(StringView { "{:{2}}" }, -5, 8, 16), " -5"); - EXPECT_EQ(String::formatted(StringView { "{{{:*^{1}}}}" }, 1, 3), "{*1*}"); - EXPECT_EQ(String::formatted(StringView { "{:0{}}" }, 1, 3), "001"); + EXPECT_EQ(String::formatted("{{{:*^{1}}}}", 1, 3), "{*1*}"); + EXPECT_EQ(String::formatted("{:0{}}", 1, 3), "001"); } TEST_CASE(replacement_field_regression) |