()
| 743 | #[tokio::test] |
| 744 | #[cfg_attr(miri, ignore)] |
| 745 | async fn linker_module_reactor() -> Result<()> { |
| 746 | let mut store = async_store(); |
| 747 | let mut linker = Linker::new(store.engine()); |
| 748 | let module1 = Module::new( |
| 749 | store.engine(), |
| 750 | r#" |
| 751 | (module |
| 752 | (global $g (mut i32) (i32.const 0)) |
| 753 | |
| 754 | (func (export "g") (result i32) |
| 755 | global.get $g |
| 756 | i32.const 1 |
| 757 | global.set $g) |
| 758 | ) |
| 759 | "#, |
| 760 | )?; |
| 761 | let module2 = Module::new( |
| 762 | store.engine(), |
| 763 | r#" |
| 764 | (module |
| 765 | (import "" "g" (func (result i32))) |
| 766 | |
| 767 | (func (export "get") (result i32) |
| 768 | call 0) |
| 769 | ) |
| 770 | "#, |
| 771 | )?; |
| 772 | |
| 773 | linker.module_async(&mut store, "", &module1).await?; |
| 774 | let instance = linker.instantiate_async(&mut store, &module2).await?; |
| 775 | let f = instance.get_typed_func::<(), i32>(&mut store, "get")?; |
| 776 | assert_eq!(f.call_async(&mut store, ()).await?, 0); |
| 777 | assert_eq!(f.call_async(&mut store, ()).await?, 1); |
| 778 | |
| 779 | Ok(()) |
| 780 | } |
| 781 | |
| 782 | pub struct CountPending<F> { |
| 783 | future: F, |
nothing calls this directly
no test coverage detected