Add xchar support for write_escaped_string.

Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
This commit is contained in:
Vladislav Shchapov
2022-05-22 21:08:26 +05:00
committed by Victor Zverovich
parent 90b68783ff
commit 1f9eae7e31
3 changed files with 46 additions and 39 deletions

View File

@@ -70,13 +70,9 @@ struct box {
int value;
};
auto begin(const box& b) -> const int* {
return &b.value;
}
auto begin(const box& b) -> const int* { return &b.value; }
auto end(const box& b) -> const int* {
return &b.value + 1;
}
auto end(const box& b) -> const int* { return &b.value + 1; }
} // namespace adl
TEST(ranges_test, format_adl_begin_end) {
@@ -370,6 +366,7 @@ TEST(ranges_test, escape_string) {
EXPECT_EQ(fmt::format("{}", vec{"\xf0\xaa\x9b\x9e"}), "[\"\\U0002a6de\"]");
EXPECT_EQ(fmt::format("{}", vec{"\xf4\x8f\xbf\xc0"}),
"[\"\\xf4\\x8f\\xbf\\xc0\"]");
EXPECT_EQ(fmt::format("{}", vec{"понедельник"}), "[\"понедельник\"]");
}
}