| 59 | |
| 60 | template <> |
| 61 | val asyncCoro<0>() { |
| 62 | // check that just sleeping works |
| 63 | co_await promise_sleep(1); |
| 64 | // check that sleeping and receiving value works |
| 65 | val v = co_await promise_sleep(1, 12); |
| 66 | assert(v.as<int>() == 12); |
| 67 | // check that awaiting a subclassed promise works and returns the correct type |
| 68 | int x = co_await typed_promise<int>(promise_sleep(1, 23)); |
| 69 | assert(x == 23); |
| 70 | // check that returning value works (checked by JS in tests) |
| 71 | co_return 34; |
| 72 | } |
| 73 | |
| 74 | template <size_t N> |
| 75 | val throwingCoro() { |
nothing calls this directly
no test coverage detected