Fix ostream support in sprintf (#1631)
This commit is contained in:
+2
-1
@@ -210,7 +210,8 @@ TEST(ArgTest, FormatArgs) {
|
||||
}
|
||||
|
||||
struct custom_context {
|
||||
typedef char char_type;
|
||||
using char_type = char;
|
||||
using parse_context_type = fmt::format_parse_context;
|
||||
|
||||
template <typename T> struct formatter_type {
|
||||
template <typename ParseContext>
|
||||
|
||||
+3
-2
@@ -2260,8 +2260,9 @@ struct test_parse_context {
|
||||
};
|
||||
|
||||
struct test_context {
|
||||
typedef char char_type;
|
||||
typedef fmt::basic_format_arg<test_context> format_arg;
|
||||
using char_type = char;
|
||||
using format_arg = fmt::basic_format_arg<test_context>;
|
||||
using parse_context_type = fmt::format_parse_context;
|
||||
|
||||
template <typename T> struct formatter_type {
|
||||
typedef fmt::formatter<T, char_type> type;
|
||||
|
||||
+1
-3
@@ -508,9 +508,7 @@ TEST(PrintfTest, PrintfError) {
|
||||
TEST(PrintfTest, WideString) { EXPECT_EQ(L"abc", fmt::sprintf(L"%s", L"abc")); }
|
||||
|
||||
TEST(PrintfTest, PrintfCustom) {
|
||||
// The test is disabled for now because it requires decoupling
|
||||
// fallback_formatter::format from format_context.
|
||||
//EXPECT_EQ("abc", test_sprintf("%s", TestString("abc")));
|
||||
EXPECT_EQ("abc", test_sprintf("%s", TestString("abc")));
|
||||
}
|
||||
|
||||
TEST(PrintfTest, OStream) {
|
||||
|
||||
Reference in New Issue
Block a user