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

Function strings

tests/all/component_model/dynamic.rs:93–106  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

91
92#[test]
93fn strings() -> Result<()> {
94 let engine = super::engine();
95 let mut store = Store::new(&engine, ());
96
97 let component = Component::new(&engine, make_echo_component("string", 8))?;
98 let instance = Linker::new(&engine).instantiate(&mut store, &component)?;
99 let func = instance.get_func(&mut store, "echo").unwrap();
100 let input = Val::String("hello, component!".into());
101 let mut output = [Val::Bool(false)];
102 func.call(&mut store, &[input.clone()], &mut output)?;
103 assert_eq!(input, output[0]);
104
105 Ok(())
106}
107
108#[test]
109fn lists() -> Result<()> {

Callers

nothing calls this directly

Calls 9

make_echo_componentFunction · 0.85
OkFunction · 0.85
engineFunction · 0.50
newFunction · 0.50
instantiateMethod · 0.45
unwrapMethod · 0.45
get_funcMethod · 0.45
callMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected