blob: 83cfde4dda11c1d3e0c405ee73b184918bd3be6e [file] [log] [blame]
Patrick Williams73e278b2022-09-16 08:31:36 -05001#include <sdbusplus/async.hpp>
2
3#include <gtest/gtest.h>
4
5TEST(Context, RunSimple)
6{
7 sdbusplus::async::context ctx;
8 ctx.run(std::execution::just() |
9 std::execution::then([&ctx]() { ctx.request_stop(); }));
10}
Patrick Williams0139cac2022-09-20 17:04:17 -050011
12TEST(Context, SpawnedTask)
13{
14 sdbusplus::async::context ctx;
15
16 ctx.spawn(std::execution::just());
17
18 ctx.run(std::execution::just() |
19 std::execution::then([&ctx]() { ctx.request_stop(); }));
20}