Updated ranges-test.cc.

This commit is contained in:
Remotion 2018-05-13 18:58:25 +02:00
parent d2ef18c7d7
commit f65bcb8b08

View File

@ -21,29 +21,29 @@
TEST(RangesTest, FormatVector) {
std::vector<int32_t> iv{1, 2, 3, 5, 7, 11};
auto ivf = fmt::format("{}", iv);
EXPECT_EQ("{1,2,3,5,7,11}", ivf);
EXPECT_EQ("{1, 2, 3, 5, 7, 11}", ivf);
}
TEST(RangesTest, FormatVector2) {
std::vector<std::vector<int32_t>> ivv{{1, 2}, {3, 5}, {7, 11}};
auto ivf = fmt::format("{}", ivv);
EXPECT_EQ("{{1,2},{3,5},{7,11}}", ivf);
EXPECT_EQ("{{1, 2}, {3, 5}, {7, 11}}", ivf);
}
TEST(RangesTest, FormatMap) {
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) {
std::pair<int64_t, float> pa1{42, 3.14159265358979f};
EXPECT_EQ("(42,3.14159)", fmt::format("{}", pa1));
EXPECT_EQ("(42, 3.14159)", fmt::format("{}", pa1));
}
TEST(RangesTest, FormatTuple) {
std::tuple<int64_t, float, std::string> tu1{42, 3.14159265358979f,
"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.