* limitations under the License.
*/
-#include <folly/futures/Future.h>
-#include <folly/futures/InlineExecutor.h>
-#include <folly/futures/ManualExecutor.h>
-#include <folly/futures/QueuedImmediateExecutor.h>
#include <folly/Baton.h>
+#include <folly/executors/InlineExecutor.h>
+#include <folly/executors/ManualExecutor.h>
+#include <folly/executors/QueuedImmediateExecutor.h>
+#include <folly/futures/Future.h>
#include <folly/portability/GTest.h>
+// TODO(jsedgwick) move this test to executors/test/ once the tested executors
+// have all moved
+
using namespace folly;
TEST(ManualExecutor, runIsStable) {
EXPECT_EQ(counter, 1);
}
-TEST(Executor, RunnablePtr) {
- InlineExecutor x;
- struct Runnable {
- std::function<void()> fn;
- void operator()() { fn(); }
- };
- size_t counter = 0;
- auto fnp = std::make_shared<Runnable>();
- fnp->fn = [&]{ counter++; };
- x.addPtr(fnp);
- EXPECT_EQ(counter, 1);
-}
-
TEST(Executor, ThrowableThen) {
InlineExecutor x;
+ auto f = Future<Unit>().then([]() { throw std::runtime_error("Faildog"); });
+
+ /*
auto f = Future<Unit>().via(&x).then([](){
throw std::runtime_error("Faildog");
- });
+ });*/
EXPECT_THROW(f.value(), std::exception);
}