mirror of
https://github.com/Naios/continuable.git
synced 2026-02-09 03:06:41 +08:00
improve a test
This commit is contained in:
parent
42223d72dc
commit
7484c671af
15
Test.cpp
15
Test.cpp
@ -202,9 +202,22 @@ TEST_CASE("Continuable continuation chaining using Continuable::then", "[Continu
|
|||||||
{
|
{
|
||||||
REQUIRE(invoked == 2);
|
REQUIRE(invoked == 2);
|
||||||
invoked = 3;
|
invoked = 3;
|
||||||
|
|
||||||
|
return make_continuable([&](Callback<std::size_t>&& callback)
|
||||||
|
{
|
||||||
|
REQUIRE(invoked == 3);
|
||||||
|
invoked = 4;
|
||||||
|
|
||||||
|
callback(5);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.then([&](std::size_t t)
|
||||||
|
{
|
||||||
|
REQUIRE(invoked == 4);
|
||||||
|
invoked = t;
|
||||||
});
|
});
|
||||||
|
|
||||||
REQUIRE(invoked == 3);
|
REQUIRE(invoked == 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
SECTION("Continuation chains need a callback to continue")
|
SECTION("Continuation chains need a callback to continue")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user