Correct buffer growth when formatting time (#367)

This commit is contained in:
Victor Zverovich
2016-08-04 08:34:07 -07:00
parent 9dbb60c4c8
commit 1a23f9c274
4 changed files with 31 additions and 11 deletions

View File

@@ -60,7 +60,6 @@ lconv *localeconv() {
}
#include "fmt/format.h"
#include "fmt/time.h"
#include "util.h"
#include "mock-allocator.h"
@@ -1551,15 +1550,6 @@ TEST(FormatTest, Variadic) {
EXPECT_EQ(L"abc1", format(L"{}c{}", L"ab", 1));
}
TEST(FormatTest, Time) {
std::tm tm = std::tm();
tm.tm_year = 116;
tm.tm_mon = 3;
tm.tm_mday = 25;
EXPECT_EQ("The date is 2016-04-25.",
fmt::format("The date is {:%Y-%m-%d}.", tm));
}
template <typename T>
std::string str(const T &value) {
return fmt::format("{}", value);