()
| 497 | #[tokio::test] |
| 498 | #[cfg_attr(miri, ignore)] |
| 499 | async fn resume_separate_thread() { |
| 500 | // This test will poll the following future on two threads. Simulating a |
| 501 | // trap requires accessing TLS info, so that should be preserved correctly. |
| 502 | execute_across_threads(async { |
| 503 | let mut store = async_store(); |
| 504 | let module = Module::new( |
| 505 | store.engine(), |
| 506 | " |
| 507 | (module |
| 508 | (import \"\" \"\" (func)) |
| 509 | (start 0) |
| 510 | ) |
| 511 | ", |
| 512 | ) |
| 513 | .unwrap(); |
| 514 | let func = Func::wrap_async(&mut store, |_, _: ()| { |
| 515 | Box::new(async { |
| 516 | tokio::task::yield_now().await; |
| 517 | Err::<(), _>(format_err!("test")) |
| 518 | }) |
| 519 | }); |
| 520 | let result = Instance::new_async(&mut store, &module, &[func.into()]).await; |
| 521 | assert!(result.is_err()); |
| 522 | }) |
| 523 | .await; |
| 524 | } |
| 525 | |
| 526 | #[tokio::test] |
| 527 | #[cfg_attr(miri, ignore)] |
nothing calls this directly
no test coverage detected