Files
wazero/examples/multiple-results/multiple-results_test.go
Crypt Keeper c4caa1ea9b Changes how examples are tested, and fixes ExitError bug (#468)
Before, we tested the examples/ directory using "ExampleXX", but this is
not ideal because it literally embeds the call to `main` into example
godoc output. This stops doing that for a different infrastructure.

This also makes sure there's a godoc example for both the main package
and wasi, so that people looking at https://pkg.go.dev see something and
also a link to our real examples directory.

Signed-off-by: Adrian Cole <adrian@tetrate.io>
2022-04-15 15:51:27 +08:00

21 lines
478 B
Go

package multiple_results
import (
"testing"
"github.com/tetratelabs/wazero/internal/testing/maintester"
"github.com/tetratelabs/wazero/internal/testing/require"
)
// Test_main ensures the following will work:
//
// go run multiple-results.go
func Test_main(t *testing.T) {
stdout, _ := maintester.TestMain(t, main, "multiple-results")
require.Equal(t, `result-offset/wasm: age=37
result-offset/host: age=37
multi-value/wasm: age=37
multi-value/host: age=37
`, stdout)
}