Fixed the one chrono test that compared %S of fmt:format with strftime, to compare only up to seconds

This commit is contained in:
Filip Brcic 2021-05-18 18:37:42 +02:00
parent 10591ac477
commit e2c27043c1
No known key found for this signature in database
GPG Key ID: 15FB92681DE569DA

View File

@ -94,7 +94,7 @@ template <typename TimePoint> auto strftime(TimePoint tp) -> std::string {
} }
TEST(chrono_test, time_point) { TEST(chrono_test, time_point) {
auto t1 = std::chrono::system_clock::now(); auto t1 = std::chrono::time_point_cast<std::chrono::seconds>(std::chrono::system_clock::now());
EXPECT_EQ(strftime(t1), fmt::format("{:%Y-%m-%d %H:%M:%S}", t1)); EXPECT_EQ(strftime(t1), fmt::format("{:%Y-%m-%d %H:%M:%S}", t1));
using time_point = using time_point =
std::chrono::time_point<std::chrono::system_clock, std::chrono::seconds>; std::chrono::time_point<std::chrono::system_clock, std::chrono::seconds>;