engine: Fix up some send/recv corner cases
Initially I wasn't 100% clear or decided on the send/recv semantics. After some experimenting, I think this is much closer to what we want. Nothing should break or regress here, this only enables more possibilities.
This commit is contained in:
@@ -35,6 +35,7 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os/exec"
|
||||
"path"
|
||||
"strings"
|
||||
"syscall"
|
||||
"testing"
|
||||
@@ -46,7 +47,8 @@ import (
|
||||
)
|
||||
|
||||
func fakeExecInit(t *testing.T) (*engine.Init, *ExecSends) {
|
||||
debug := testing.Verbose() // set via the -test.v flag to `go test`
|
||||
tmpdir := fmt.Sprintf("%s/", t.TempDir()) // gets cleaned up at end, new dir for each call
|
||||
debug := testing.Verbose() // set via the -test.v flag to `go test`
|
||||
logf := func(format string, v ...interface{}) {
|
||||
t.Logf("test: "+format, v...)
|
||||
}
|
||||
@@ -60,6 +62,9 @@ func fakeExecInit(t *testing.T) (*engine.Init, *ExecSends) {
|
||||
*execSends = *x // set
|
||||
return nil
|
||||
},
|
||||
VarDir: func(p string) (string, error) {
|
||||
return path.Join(tmpdir, p), nil
|
||||
},
|
||||
Debug: debug,
|
||||
Logf: logf,
|
||||
}, execSends
|
||||
|
||||
Reference in New Issue
Block a user