(t *testing.T)
| 51 | } |
| 52 | |
| 53 | func TestInstanceBad(t *testing.T) { |
| 54 | store := NewStore(NewEngine()) |
| 55 | wasm, err := Wat2Wasm(`(module (import "" "" (func)))`) |
| 56 | require.NoError(t, err) |
| 57 | module, err := NewModule(NewEngine(), wasm) |
| 58 | require.NoError(t, err) |
| 59 | |
| 60 | // wrong number of imports |
| 61 | instance, err := NewInstance(store, module, []AsExtern{}) |
| 62 | require.Nil(t, instance) |
| 63 | require.Error(t, err) |
| 64 | |
| 65 | // wrong types of imports |
| 66 | f := WrapFunc(store, func(a int32) {}) |
| 67 | instance, err = NewInstance(store, module, []AsExtern{f}) |
| 68 | require.Nil(t, instance) |
| 69 | require.Error(t, err) |
| 70 | } |
| 71 | |
| 72 | func TestInstanceGetFunc(t *testing.T) { |
| 73 | wasm, err := Wat2Wasm(` |
nothing calls this directly
no test coverage detected
searching dependent graphs…