Skip to content

Commit 9d14489

Browse files
dgryskiaykevl
authored andcommitted
TestWebAssembly: use wasm-unknown for panic=trap test
1 parent f3dfe1d commit 9d14489

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

main_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -470,20 +470,21 @@ func TestWebAssembly(t *testing.T) {
470470
t.Parallel()
471471
type testCase struct {
472472
name string
473+
target string
473474
panicStrategy string
474475
imports []string
475476
}
476477
for _, tc := range []testCase{
477478
// Test whether there really are no imports when using -panic=trap. This
478479
// tests the bugfix for https://github.com/tinygo-org/tinygo/issues/4161.
479-
{name: "panic-default", imports: []string{"wasi_snapshot_preview1.fd_write"}},
480-
{name: "panic-trap", panicStrategy: "trap", imports: []string{}},
480+
{name: "panic-default", target: "wasip1", imports: []string{"wasi_snapshot_preview1.fd_write", "wasi_snapshot_preview1.random_get"}},
481+
{name: "panic-trap", target: "wasm-unknown", panicStrategy: "trap", imports: []string{}},
481482
} {
482483
tc := tc
483484
t.Run(tc.name, func(t *testing.T) {
484485
t.Parallel()
485486
tmpdir := t.TempDir()
486-
options := optionsFromTarget("wasi", sema)
487+
options := optionsFromTarget(tc.target, sema)
487488
options.PanicStrategy = tc.panicStrategy
488489
config, err := builder.NewConfig(&options)
489490
if err != nil {

0 commit comments

Comments
 (0)