Fix handling of default alignmment with locale (#1801)

This commit is contained in:
Victor Zverovich
2020-08-03 10:51:42 -07:00
parent 37c8f4eaf3
commit 0907c08ae5
2 changed files with 10 additions and 2 deletions

View File

@@ -68,6 +68,11 @@ TEST(LocaleTest, Format) {
fmt::format(small_grouping_loc, "{:L}", max_value<uint32_t>()));
}
TEST(LocaleTest, FormatDetaultAlign) {
std::locale special_grouping_loc(std::locale(), new special_grouping<char>());
EXPECT_EQ(" 12,345", fmt::format(special_grouping_loc, "{:8L}", 12345));
}
TEST(LocaleTest, WFormat) {
std::locale loc(std::locale(), new numpunct<wchar_t>());
EXPECT_EQ(L"1234567", fmt::format(std::locale(), L"{:L}", 1234567));