runImmediatly fix
[folly.git] / folly / io / async / test / EventBaseTest.cpp
index b9716a7cc9d1bef9c18ed42aa961eec0ab7eafab..349391a01190893fba38c43c1216b258beca1b6e 100644 (file)
@@ -1246,6 +1246,15 @@ TEST(EventBaseTest, RunImmediatelyOrRunInEventBaseThreadAndWaitWithin) {
   });
 }
 
+TEST(EventBaseTest, RunImmediatelyOrRunInEventBaseThreadNotLooping) {
+  EventBase eb;
+  auto mutated = false;
+  eb.runImmediatelyOrRunInEventBaseThreadAndWait([&] {
+      mutated = true;
+    });
+  EXPECT_TRUE(mutated);
+}
+
 ///////////////////////////////////////////////////////////////////////////
 // Tests for runInLoop()
 ///////////////////////////////////////////////////////////////////////////