func (r *Result) Compare(exp Expected) error {
	return r.match(exp)
}
Compare the result to Expected and return an error if they do not match.
package icmd  
import (
	"bytes"
	"fmt"
	"io"
	"os"
	"os/exec"
	"strings"
	"sync"
	"time"
	"gotest.tools/v3/assert"
	"gotest.tools/v3/assert/cmp"
)
type helperT interface {
	Helper()
}
const None = "[NOTHING]"
type lockedBuffer struct {
	m   sync.RWMutex
	buf bytes.Buffer
}
func (buf *lockedBuffer) Write(b []byte) (int, error) {
	buf.m.Lock()
	defer buf.m.Unlock()
	return buf.buf.Write(b)
}
func (buf *lockedBuffer) String() string {
	buf.m.RLock()
	defer buf.m.RUnlock()
	return buf.buf.String()
}
type Result struct {
	Cmd      *exec.Cmd
	ExitCode int
	Error    error
	Timeout   bool
	outBuffer *lockedBuffer
	errBuffer *lockedBuffer
}
func (r *Result) Assert(t assert.TestingT, exp Expected) *Result {
	if ht, ok := t.(helperT); ok {
		ht.Helper()
	}
	assert.Assert(t, r.Equal(exp))
	return r
}
func (r *Result) Equal(exp Expected) cmp.Comparison {
	return func() cmp.Result {
		return cmp.ResultFromError(r.match(exp))
	}
}