Patrick Williams | 73e278b | 2022-09-16 08:31:36 -0500 | [diff] [blame] | 1 | #include <sdbusplus/async.hpp> |
| 2 | |
| 3 | #include <gtest/gtest.h> |
| 4 | |
| 5 | TEST(Context, RunSimple) |
| 6 | { |
| 7 | sdbusplus::async::context ctx; |
| 8 | ctx.run(std::execution::just() | |
| 9 | std::execution::then([&ctx]() { ctx.request_stop(); })); |
| 10 | } |
Patrick Williams | 0139cac | 2022-09-20 17:04:17 -0500 | [diff] [blame] | 11 | |
| 12 | TEST(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 | } |