externals/fmt: Update fmt to 5.3.0

Merge commit '0066ad2d38' into HEAD
This commit is contained in:
MerryMage 2020-04-22 21:00:18 +01:00
commit 51fe05a443
41 changed files with 3817 additions and 2059 deletions

View file

@ -10,6 +10,7 @@
#endif
#include "gmock.h"
#include "fmt/locale.h"
#include "fmt/time.h"
TEST(TimeTest, Format) {
@ -26,10 +27,18 @@ TEST(TimeTest, GrowBuffer) {
for (int i = 0; i < 30; ++i)
s += "%c";
s += "}\n";
std::time_t t = std::time(nullptr);
std::time_t t = std::time(FMT_NULL);
fmt::format(s, *std::localtime(&t));
}
TEST(TimeTest, FormatToEmptyContainer) {
std::string s;
auto time = std::tm();
time.tm_sec = 42;
fmt::format_to(std::back_inserter(s), "{:%S}", time);
EXPECT_EQ(s, "42");
}
TEST(TimeTest, EmptyResult) {
EXPECT_EQ("", fmt::format("{}", std::tm()));
}
@ -47,13 +56,13 @@ static bool EqualTime(const std::tm &lhs, const std::tm &rhs) {
}
TEST(TimeTest, LocalTime) {
std::time_t t = std::time(nullptr);
std::time_t t = std::time(FMT_NULL);
std::tm tm = *std::localtime(&t);
EXPECT_TRUE(EqualTime(tm, fmt::localtime(t)));
}
TEST(TimeTest, GMTime) {
std::time_t t = std::time(nullptr);
std::time_t t = std::time(FMT_NULL);
std::tm tm = *std::gmtime(&t);
EXPECT_TRUE(EqualTime(tm, fmt::gmtime(t)));
}