diff options
Diffstat (limited to 'absl/time/time_test.cc')
-rw-r--r-- | absl/time/time_test.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/absl/time/time_test.cc b/absl/time/time_test.cc index d235e9ad..6a89399d 100644 --- a/absl/time/time_test.cc +++ b/absl/time/time_test.cc @@ -28,6 +28,7 @@ #include "gmock/gmock.h" #include "gtest/gtest.h" #include "absl/numeric/int128.h" +#include "absl/strings/str_format.h" #include "absl/time/clock.h" #include "absl/time/internal/test_util.h" @@ -1287,4 +1288,11 @@ TEST(Time, PrevTransitionNYC) { // We have a transition but we don't know which one. } +TEST(Time, AbslStringify) { + // FormatTime is already well tested, so just use one test case here to + // verify that StrFormat("%v", t) works as expected. + absl::Time t = absl::Now(); + EXPECT_EQ(absl::StrFormat("%v", t), absl::FormatTime(t)); +} + } // namespace |