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

Function run_a_command

cranelift/reader/src/run_command.rs:132–141  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

130
131 #[test]
132 fn run_a_command() {
133 let mut signature = Signature::new(CallConv::Fast);
134 signature.returns.push(AbiParam::new(types::I32));
135 let command = parse_run_command(";; run: %return42() == 42 ", &signature)
136 .unwrap()
137 .unwrap();
138
139 assert!(command.run(|_, _| Ok(vec![DataValue::I32(42)])).is_ok());
140 assert!(command.run(|_, _| Ok(vec![DataValue::I32(43)])).is_err());
141 }
142}

Callers

nothing calls this directly

Calls 4

parse_run_commandFunction · 0.85
newFunction · 0.50
pushMethod · 0.45
unwrapMethod · 0.45

Tested by

no test coverage detected