wasi-module-sdk-go/integration/logging.go

24 lines
314 B
Go
Raw Normal View History

2023-05-08 13:21:31 +00:00
package integration
import (
"io"
"testing"
)
var _ io.Writer = (*TestWriter)(nil)
func NewTestWriter(tb testing.TB) TestWriter {
return TestWriter{
TB: tb,
}
}
type TestWriter struct {
TB testing.TB
}
func (t TestWriter) Write(p []byte) (n int, err error) {
t.TB.Log(string(p))
return len(p), nil
}