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

Function struct_fields_empty

tests/all/structs.rs:319–328  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

317
318#[test]
319fn struct_fields_empty() -> Result<()> {
320 let mut store = gc_store()?;
321 let struct_ty = StructType::new(store.engine(), [])?;
322 let pre = StructRefPre::new(&mut store, struct_ty.clone());
323 let s = StructRef::new(&mut store, &pre, &[])?;
324 let fields = s.fields(&mut store)?;
325 assert_eq!(fields.len(), 0);
326 assert!(fields.collect::<Vec<_>>().is_empty());
327 Ok(())
328}
329
330#[test]
331fn struct_fields_non_empty() -> Result<()> {

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected