()
| 210 | |
| 211 | #[test] |
| 212 | fn array_len_non_empty() -> Result<()> { |
| 213 | let mut store = gc_store()?; |
| 214 | |
| 215 | let array_ty = ArrayType::new( |
| 216 | store.engine(), |
| 217 | FieldType::new(Mutability::Const, ValType::I32.into()), |
| 218 | ); |
| 219 | let pre = ArrayRefPre::new(&mut store, array_ty); |
| 220 | |
| 221 | let array = ArrayRef::new_fixed( |
| 222 | &mut store, |
| 223 | &pre, |
| 224 | &[Val::I32(11), Val::I32(22), Val::I32(33)], |
| 225 | )?; |
| 226 | assert_eq!(array.len(&store)?, 3); |
| 227 | |
| 228 | Ok(()) |
| 229 | } |
| 230 | |
| 231 | #[test] |
| 232 | fn array_get_in_bounds() -> Result<()> { |