@@ -111,19 +111,27 @@ TEST(std_test, optional) {
111
111
TEST (std_test, expected) {
112
112
#ifdef __cpp_lib_expected
113
113
EXPECT_EQ (fmt::format (" {}" , std::expected<int , int >{1 }), " expected(1)" );
114
- EXPECT_EQ (fmt::format (" {}" , std::expected<int , int >{std::unexpected (1 )}), " unexpected(1)" );
115
- EXPECT_EQ (fmt::format (" {}" , std::expected<std::string, int >{" test" }), " expected(\" test\" )" );
116
- EXPECT_EQ (fmt::format (" {}" , std::expected<int , std::string>{std::unexpected (" test" )}), " unexpected(\" test\" )" );
114
+ EXPECT_EQ (fmt::format (" {}" , std::expected<int , int >{std::unexpected (1 )}),
115
+ " unexpected(1)" );
116
+ EXPECT_EQ (fmt::format (" {}" , std::expected<std::string, int >{" test" }),
117
+ " expected(\" test\" )" );
118
+ EXPECT_EQ (fmt::format (
119
+ " {}" , std::expected<int , std::string>{std::unexpected (" test" )}),
120
+ " unexpected(\" test\" )" );
117
121
EXPECT_EQ (fmt::format (" {}" , std::expected<char , int >{' a' }), " expected('a')" );
118
- EXPECT_EQ (fmt::format (" {}" , std::expected<int , char >{std::unexpected (' a' )}), " unexpected('a')" );
122
+ EXPECT_EQ (fmt::format (" {}" , std::expected<int , char >{std::unexpected (' a' )}),
123
+ " unexpected('a')" );
119
124
120
125
struct unformattable1 {};
121
126
struct unformattable2 {};
122
127
EXPECT_FALSE ((fmt::is_formattable<unformattable1>::value));
123
128
EXPECT_FALSE ((fmt::is_formattable<unformattable2>::value));
124
- EXPECT_FALSE ((fmt::is_formattable<std::expected<unformattable1, unformattable2>>::value));
125
- EXPECT_FALSE ((fmt::is_formattable<std::expected<unformattable1, int >>::value));
126
- EXPECT_FALSE ((fmt::is_formattable<std::expected<int , unformattable2>>::value));
129
+ EXPECT_FALSE ((fmt::is_formattable<
130
+ std::expected<unformattable1, unformattable2>>::value));
131
+ EXPECT_FALSE (
132
+ (fmt::is_formattable<std::expected<unformattable1, int >>::value));
133
+ EXPECT_FALSE (
134
+ (fmt::is_formattable<std::expected<int , unformattable2>>::value));
127
135
EXPECT_TRUE ((fmt::is_formattable<std::expected<int , int >>::value));
128
136
#endif
129
137
}
0 commit comments