MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / smoke_with_suspension

Function smoke_with_suspension

tests/all/async_functions.rs:75–95  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

73
74#[tokio::test]
75async fn smoke_with_suspension() {
76 let mut store = async_store();
77 let func_ty = FuncType::new(store.engine(), None, None);
78 let func = Func::new_async(&mut store, func_ty, move |_caller, _params, _results| {
79 Box::new(async {
80 tokio::task::yield_now().await;
81 Ok(())
82 })
83 });
84 run_smoke_test(&mut store, func).await;
85 run_smoke_typed_test(&mut store, func).await;
86
87 let func = Func::wrap_async(&mut store, move |_caller, _: ()| {
88 Box::new(async {
89 tokio::task::yield_now().await;
90 Ok(())
91 })
92 });
93 run_smoke_test(&mut store, func).await;
94 run_smoke_typed_test(&mut store, func).await;
95}
96
97#[tokio::test]
98async fn smoke_host_func_with_suspension() -> Result<()> {

Callers

nothing calls this directly

Calls 7

yield_nowFunction · 0.85
OkFunction · 0.85
run_smoke_testFunction · 0.85
run_smoke_typed_testFunction · 0.85
async_storeFunction · 0.70
newFunction · 0.50
engineMethod · 0.45

Tested by

no test coverage detected