(t *testing.T)
| 120 | } |
| 121 | |
| 122 | func TestFuncWrongRet2(t *testing.T) { |
| 123 | store := NewStore(NewEngine()) |
| 124 | cb := func(caller *Caller, args []Val) ([]Val, *Trap) { |
| 125 | return []Val{}, nil |
| 126 | } |
| 127 | i32 := NewValType(KindI32) |
| 128 | f := NewFunc(store, NewFuncType([]*ValType{}, []*ValType{i32}), cb) |
| 129 | |
| 130 | var caught interface{} |
| 131 | func() { |
| 132 | defer func() { caught = recover() }() |
| 133 | f.Call(store) |
| 134 | }() |
| 135 | require.NotNil(t, caught, "expected a panic") |
| 136 | require.IsType(t, caught, string("")) |
| 137 | require.Containsf(t, caught.(string), "callback didn't produce the correct number of results", "wrong panic message %s", caught) |
| 138 | } |
| 139 | |
| 140 | func TestFuncWrapSimple(t *testing.T) { |
| 141 | store := NewStore(NewEngine()) |
nothing calls this directly
no test coverage detected
searching dependent graphs…