minor Timekeeper bug
[folly.git] / folly / futures / test / TimekeeperTest.cpp
index fdf147c5e7e252589e0e2b76be1ec1f16a901a98..eddf2e811739db0e7f187f476130c64108d24d10 100644 (file)
@@ -198,3 +198,16 @@ TEST(Timekeeper, onTimeoutPropagates) {
   EXPECT_TRUE(flag);
 }
 */
+
+TEST_F(TimekeeperFixture, atBeforeNow) {
+  auto f = timeLord_->at(now() - too_long);
+  EXPECT_TRUE(f.isReady());
+  EXPECT_FALSE(f.hasException());
+}
+
+TEST_F(TimekeeperFixture, howToCastDuration) {
+  // I'm not sure whether this rounds up or down but it's irrelevant for the
+  // purpose of this example.
+  auto f = timeLord_->after(std::chrono::duration_cast<Duration>(
+      std::chrono::nanoseconds(1)));
+}