|
|
@@ -50,3 +50,18 @@ TEST(FormatTest, CatchesRawContentAfterFmt) {
|
|
|
auto fmt = format::parse_format_string("%%TEST");
|
|
|
EXPECT_THAT(fmt.process({}), Eq("%TEST"));
|
|
|
}
|
|
|
+
|
|
|
+// Thursday, April 4, 2019 6:17:20 PM GMT
|
|
|
+constexpr const int NOW = 1554401840;
|
|
|
+
|
|
|
+TEST(FormatTest, HandlesDateFormatter) {
|
|
|
+ using testing::Eq;
|
|
|
+ auto fmt = format::parse_format_string("%d");
|
|
|
+ EXPECT_THAT(fmt.process({{NOW,0}}), Eq("2019-04-04 18:17:20,000"));
|
|
|
+}
|
|
|
+
|
|
|
+TEST(FormatTest, FormatsMicroseconds) {
|
|
|
+ using testing::Eq;
|
|
|
+ auto fmt = format::parse_format_string("%d");
|
|
|
+ EXPECT_THAT(fmt.process({{NOW,123000}}), Eq("2019-04-04 18:17:20,123"));
|
|
|
+}
|