MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime-go / TestFuncWrapRet1

Function TestFuncWrapRet1

func_test.go:193–202  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

191}
192
193func TestFuncWrapRet1(t *testing.T) {
194 store := NewStore(NewEngine())
195 f := WrapFunc(store, func(c *Caller) int32 {
196 return 1
197 })
198 result, trap := f.Call(store)
199 require.Nil(t, trap)
200 require.IsType(t, result, int32(0), "wrong result")
201 require.Equal(t, int32(1), result.(int32), "wrong result")
202}
203
204func TestFuncWrapRet2(t *testing.T) {
205 store := NewStore(NewEngine())

Callers

nothing calls this directly

Calls 4

NewStoreFunction · 0.85
NewEngineFunction · 0.85
WrapFuncFunction · 0.85
CallMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…