Commit 5b5a5971 authored by Victor Zverovich's avatar Victor Zverovich

Fix handling of wide alignment

parent f80ed64d
...@@ -2501,7 +2501,7 @@ FMT_CONSTEXPR const Char* parse_align(const Char* begin, const Char* end, ...@@ -2501,7 +2501,7 @@ FMT_CONSTEXPR const Char* parse_align(const Char* begin, const Char* end,
auto p = next_code_point(begin, end); auto p = next_code_point(begin, end);
if (p == end) p = begin; if (p == end) p = begin;
for (;;) { for (;;) {
switch (static_cast<char>(*p)) { switch (static_cast<int>(*p)) {
case '<': case '<':
align = align::left; align = align::left;
break; break;
......
...@@ -1525,6 +1525,7 @@ TEST(FormatterTest, WideFormatString) { ...@@ -1525,6 +1525,7 @@ TEST(FormatterTest, WideFormatString) {
EXPECT_EQ(L"4.2", format(L"{}", 4.2)); EXPECT_EQ(L"4.2", format(L"{}", 4.2));
EXPECT_EQ(L"abc", format(L"{}", L"abc")); EXPECT_EQ(L"abc", format(L"{}", L"abc"));
EXPECT_EQ(L"z", format(L"{}", L'z')); EXPECT_EQ(L"z", format(L"{}", L'z'));
EXPECT_THROW(fmt::format(L"{:*\x343E}", 42), fmt::format_error);
} }
TEST(FormatterTest, FormatStringFromSpeedTest) { TEST(FormatterTest, FormatStringFromSpeedTest) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment