(t *testing.T)
| 243 | } |
| 244 | |
| 245 | func TestPanicInHostFunctionDuringInstantiate(t *testing.T) { |
| 246 | engine := NewEngine() |
| 247 | linker := NewLinker(engine) |
| 248 | store := NewStore(engine) |
| 249 | err := linker.FuncWrap("foo", "bar", func() { |
| 250 | panic("hi") |
| 251 | }) |
| 252 | require.NoError(t, err) |
| 253 | |
| 254 | wasm, err := Wat2Wasm(` |
| 255 | (module |
| 256 | (import "foo" "bar" (func)) |
| 257 | (start 0) |
| 258 | ) |
| 259 | `) |
| 260 | require.NoError(t, err) |
| 261 | |
| 262 | module, err := NewModule(engine, wasm) |
| 263 | require.NoError(t, err) |
| 264 | require.PanicsWithValue(t, "hi", func() { |
| 265 | linker.Instantiate(store, module) |
| 266 | }) |
| 267 | } |
| 268 | |
| 269 | func TestPanicInHostFunctionDuringCall(t *testing.T) { |
| 270 | engine := NewEngine() |
nothing calls this directly
no test coverage detected
searching dependent graphs…