github.com/tetratelabs/wazero@v1.7.3-0.20240513003603-48f702e154b5/examples/concurrent-instantiation/main_test.go (about)

     1  package main
     2  
     3  import (
     4  	"strconv"
     5  	"strings"
     6  	"testing"
     7  
     8  	"github.com/tetratelabs/wazero/internal/testing/maintester"
     9  	"github.com/tetratelabs/wazero/internal/testing/require"
    10  )
    11  
    12  // Test_main ensures the following will work:
    13  //
    14  //	go run main.go
    15  func Test_main(t *testing.T) {
    16  	stdout, _ := maintester.TestMain(t, main, "main")
    17  
    18  	for i := 0; i < 50; i++ {
    19  		require.True(t, strings.Contains(stdout, strconv.Itoa(i*2)))
    20  	}
    21  }