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

Function array_new_empty

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

Source from the content-addressed store, hash-verified

5
6#[test]
7fn array_new_empty() -> Result<()> {
8 let mut store = gc_store()?;
9 let array_ty = ArrayType::new(
10 store.engine(),
11 FieldType::new(Mutability::Const, StorageType::I8),
12 );
13 let pre = ArrayRefPre::new(&mut store, array_ty);
14 let array = ArrayRef::new(&mut store, &pre, &Val::I32(0), 0)?;
15 assert_eq!(array.len(&store)?, 0);
16 Ok(())
17}
18
19#[test]
20fn array_new_with_elems() -> Result<()> {

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