()
| 294 | #[tokio::test] |
| 295 | #[cfg_attr(miri, ignore)] |
| 296 | async fn iloop_with_fuel() { |
| 297 | let engine = Engine::new(Config::new().consume_fuel(true)).unwrap(); |
| 298 | let mut store = Store::new(&engine, ()); |
| 299 | store.set_fuel(10_000).unwrap(); |
| 300 | store.fuel_async_yield_interval(Some(100)).unwrap(); |
| 301 | let module = Module::new( |
| 302 | &engine, |
| 303 | " |
| 304 | (module |
| 305 | (func (loop br 0)) |
| 306 | (start 0) |
| 307 | ) |
| 308 | ", |
| 309 | ) |
| 310 | .unwrap(); |
| 311 | let instance = Instance::new_async(&mut store, &module, &[]); |
| 312 | |
| 313 | // This should yield a bunch of times but eventually finish |
| 314 | let (_, pending) = CountPending::new(Box::pin(instance)).await; |
| 315 | assert_eq!(pending, 99); |
| 316 | } |
| 317 | |
| 318 | #[tokio::test] |
| 319 | #[cfg_attr(miri, ignore)] |
nothing calls this directly
no test coverage detected