Commit efb38296 authored by Kenton Varda's avatar Kenton Varda

Add some extra expectations requested by @harrishancock.

parent b71d3cc2
...@@ -295,11 +295,13 @@ KJ_TEST("cancel cross-thread event before it runs") { ...@@ -295,11 +295,13 @@ KJ_TEST("cancel cross-thread event before it runs") {
exec = &KJ_ASSERT_NONNULL(*lock); exec = &KJ_ASSERT_NONNULL(*lock);
} }
volatile bool called = false;
{ {
Promise<uint> promise = exec->executeAsync([&]() { return 123u; }); Promise<uint> promise = exec->executeAsync([&]() { called = true; return 123u; });
delay(); delay();
KJ_EXPECT(!promise.poll(waitScope)); KJ_EXPECT(!promise.poll(waitScope));
} }
KJ_EXPECT(!called);
*executor.lockExclusive() = nullptr; *executor.lockExclusive() = nullptr;
})(); })();
...@@ -336,13 +338,16 @@ KJ_TEST("cancel cross-thread event while it runs") { ...@@ -336,13 +338,16 @@ KJ_TEST("cancel cross-thread event while it runs") {
exec = &KJ_ASSERT_NONNULL(*lock); exec = &KJ_ASSERT_NONNULL(*lock);
} }
volatile bool called = false;
{ {
Promise<uint> promise = exec->executeAsync([&]() -> kj::Promise<uint> { Promise<uint> promise = exec->executeAsync([&]() -> kj::Promise<uint> {
called = true;
return kj::NEVER_DONE; return kj::NEVER_DONE;
}); });
delay(); delay();
KJ_EXPECT(!promise.poll(waitScope)); KJ_EXPECT(!promise.poll(waitScope));
} }
KJ_EXPECT(called);
exec->executeSync([&]() { fulfiller->fulfill(); }); exec->executeSync([&]() { fulfiller->fulfill(); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment