()
| 826 | |
| 827 | #[test] |
| 828 | fn structref_ty() -> Result<()> { |
| 829 | let mut store = gc_store()?; |
| 830 | let struct_ty = StructType::new( |
| 831 | store.engine(), |
| 832 | [FieldType::new(Mutability::Const, ValType::I32.into())], |
| 833 | )?; |
| 834 | let pre = StructRefPre::new(&mut store, struct_ty.clone()); |
| 835 | let s = StructRef::new(&mut store, &pre, &[Val::I32(99)])?; |
| 836 | |
| 837 | let ty = s.ty(&store)?; |
| 838 | assert!(ty.matches(&struct_ty)); |
| 839 | |
| 840 | Ok(()) |
| 841 | } |
| 842 | |
| 843 | #[test] |
| 844 | fn structref_matches_ty() -> Result<()> { |