Fixed ranges test.
This commit is contained in:
parent
eed4a77538
commit
0f06f513d6
@ -32,7 +32,7 @@ TEST(RangesTest, FormatVector2) {
|
|||||||
|
|
||||||
TEST(RangesTest, FormatMap) {
|
TEST(RangesTest, FormatMap) {
|
||||||
std::map<std::string, int32_t> simap{{"one", 1}, {"two", 2}};
|
std::map<std::string, int32_t> simap{{"one", 1}, {"two", 2}};
|
||||||
EXPECT_EQ("{(one, 1), (two, 2)}", fmt::format("{}", simap));
|
EXPECT_EQ("{('one', 1), ('two', 2)}", fmt::format("{}", simap));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(RangesTest, FormatPair) {
|
TEST(RangesTest, FormatPair) {
|
||||||
@ -43,7 +43,7 @@ TEST(RangesTest, FormatPair) {
|
|||||||
TEST(RangesTest, FormatTuple) {
|
TEST(RangesTest, FormatTuple) {
|
||||||
std::tuple<int64_t, float, std::string> tu1{42, 3.14159265358979f,
|
std::tuple<int64_t, float, std::string> tu1{42, 3.14159265358979f,
|
||||||
"this is tuple"};
|
"this is tuple"};
|
||||||
EXPECT_EQ("(42, 3.14159, this is tuple)", fmt::format("{}", tu1));
|
EXPECT_EQ("(42, 3.14159, 'this is tuple')", fmt::format("{}", tu1));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Check if 'if constexpr' is supported.
|
/// Check if 'if constexpr' is supported.
|
||||||
@ -81,7 +81,7 @@ struct tuple_element<N, my_struct> {
|
|||||||
|
|
||||||
TEST(RangesTest, FormatStruct) {
|
TEST(RangesTest, FormatStruct) {
|
||||||
my_struct mst{13, "my struct"};
|
my_struct mst{13, "my struct"};
|
||||||
EXPECT_EQ("(13, my struct)", fmt::format("{}", mst));
|
EXPECT_EQ("(13, 'my struct')", fmt::format("{}", mst));
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // (__cplusplus > 201402L) || (defined(_MSVC_LANG) && _MSVC_LANG >
|
#endif // (__cplusplus > 201402L) || (defined(_MSVC_LANG) && _MSVC_LANG >
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user