mirror of
https://github.com/fmtlib/fmt.git
synced 2024-11-25 19:50:05 +00:00
Apply clang-format
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
This commit is contained in:
parent
73f2b344b2
commit
c710bfa10c
@ -111,19 +111,27 @@ TEST(std_test, optional) {
|
|||||||
TEST(std_test, expected) {
|
TEST(std_test, expected) {
|
||||||
#ifdef __cpp_lib_expected
|
#ifdef __cpp_lib_expected
|
||||||
EXPECT_EQ(fmt::format("{}", std::expected<int, int>{1}), "expected(1)");
|
EXPECT_EQ(fmt::format("{}", std::expected<int, int>{1}), "expected(1)");
|
||||||
EXPECT_EQ(fmt::format("{}", std::expected<int, int>{std::unexpected(1)}), "unexpected(1)");
|
EXPECT_EQ(fmt::format("{}", std::expected<int, int>{std::unexpected(1)}),
|
||||||
EXPECT_EQ(fmt::format("{}", std::expected<std::string, int>{"test"}), "expected(\"test\")");
|
"unexpected(1)");
|
||||||
EXPECT_EQ(fmt::format("{}", std::expected<int, std::string>{std::unexpected("test")}), "unexpected(\"test\")");
|
EXPECT_EQ(fmt::format("{}", std::expected<std::string, int>{"test"}),
|
||||||
|
"expected(\"test\")");
|
||||||
|
EXPECT_EQ(fmt::format(
|
||||||
|
"{}", std::expected<int, std::string>{std::unexpected("test")}),
|
||||||
|
"unexpected(\"test\")");
|
||||||
EXPECT_EQ(fmt::format("{}", std::expected<char, int>{'a'}), "expected('a')");
|
EXPECT_EQ(fmt::format("{}", std::expected<char, int>{'a'}), "expected('a')");
|
||||||
EXPECT_EQ(fmt::format("{}", std::expected<int, char>{std::unexpected('a')}), "unexpected('a')");
|
EXPECT_EQ(fmt::format("{}", std::expected<int, char>{std::unexpected('a')}),
|
||||||
|
"unexpected('a')");
|
||||||
|
|
||||||
struct unformattable1 {};
|
struct unformattable1 {};
|
||||||
struct unformattable2 {};
|
struct unformattable2 {};
|
||||||
EXPECT_FALSE((fmt::is_formattable<unformattable1>::value));
|
EXPECT_FALSE((fmt::is_formattable<unformattable1>::value));
|
||||||
EXPECT_FALSE((fmt::is_formattable<unformattable2>::value));
|
EXPECT_FALSE((fmt::is_formattable<unformattable2>::value));
|
||||||
EXPECT_FALSE((fmt::is_formattable<std::expected<unformattable1, unformattable2>>::value));
|
EXPECT_FALSE((fmt::is_formattable<
|
||||||
EXPECT_FALSE((fmt::is_formattable<std::expected<unformattable1, int>>::value));
|
std::expected<unformattable1, unformattable2>>::value));
|
||||||
EXPECT_FALSE((fmt::is_formattable<std::expected<int, unformattable2>>::value));
|
EXPECT_FALSE(
|
||||||
|
(fmt::is_formattable<std::expected<unformattable1, int>>::value));
|
||||||
|
EXPECT_FALSE(
|
||||||
|
(fmt::is_formattable<std::expected<int, unformattable2>>::value));
|
||||||
EXPECT_TRUE((fmt::is_formattable<std::expected<int, int>>::value));
|
EXPECT_TRUE((fmt::is_formattable<std::expected<int, int>>::value));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user