Files
wazero/examples/basic/add_test.go
Crypt Keeper d54008922c Redirects users to tested example (#791)
Rather than clutter both the README and home page with details that can
drift and have caused maintenance, this directs users to the tested
basic example.

This also adds a FAQ entry about TinyGo's main, thanks to @basvanbeek
for the help.

Signed-off-by: Adrian Cole <adrian@tetrate.io>
2022-09-01 09:12:37 +08:00

18 lines
361 B
Go

package main
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 add.go 7 9
func Test_main(t *testing.T) {
stdout, _ := maintester.TestMain(t, main, "add", "7", "9")
require.Equal(t, `7 + 9 = 16
`, stdout)
}