MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / array_get_on_unrooted

Function array_get_on_unrooted

tests/all/arrays.rs:277–293  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

275
276#[test]
277fn array_get_on_unrooted() -> Result<()> {
278 let mut store = gc_store()?;
279
280 let array_ty = ArrayType::new(
281 store.engine(),
282 FieldType::new(Mutability::Const, ValType::I32.into()),
283 );
284 let pre = ArrayRefPre::new(&mut store, array_ty);
285
286 let array = {
287 let mut scope = RootScope::new(&mut store);
288 ArrayRef::new_fixed(&mut scope, &pre, &[Val::I32(11)])?
289 };
290
291 assert!(array.get(&mut store, 0).is_err());
292 Ok(())
293}
294
295#[test]
296#[should_panic = "wrong store"]

Callers

nothing calls this directly

Calls 4

gc_storeFunction · 0.85
OkFunction · 0.85
newFunction · 0.50
engineMethod · 0.45

Tested by

no test coverage detected