Files
clice/tests/unit/Async/Sleep.cpp
ykiko 836d9dc988 Add basic test client (#156)
Co-authored-by: star9029 <hengxings783@gmail.com>
2025-07-21 17:55:10 +08:00

25 lines
368 B
C++

#include "Test/Test.h"
#include "Async/Async.h"
namespace clice::testing {
namespace {
TEST(Async, Sleep) {
int x = 1;
auto task_gen = [&]() -> async::Task<> {
x = 2;
co_await async::sleep(100);
x = 3;
};
auto task = task_gen();
async::run(task);
EXPECT_EQ(x, 3);
}
} // namespace
} // namespace clice::testing