package wasm import ( "math" "reflect" "strings" "testing" "time" "unsafe" "github.com/tetratelabs/wazero/api" "github.com/tetratelabs/wazero/internal/testing/require" ) func TestMemoryPageConsts(t *testing.T) { require.Equal(t, MemoryPageSize, uint32(1)< 100 { t.Fatal("too many tries waiting for wait and notify to converge") } n := mem.Notify(uint32(offset), uint32(count)) cur += int(n) time.Sleep(1 * time.Millisecond) tries++ } } func propagateWaitResult(t *testing.T, ch chan string, res uint64) { t.Helper() switch res { case 2: ch <- "timeout" default: ch <- "" } } func requireChannelEmpty(t *testing.T, ch chan string) { t.Helper() select { case <-ch: t.Fatal("channel should be empty") default: // fallthrough } }