Fixes #43793
Change-Id: I3bf022a28b194f0089ea96d93e56bbd9fb7e0aa8
Reviewed-on: https://go-review.googlesource.com/c/go/+/285056
Trust: Roland Shoemaker <roland@golang.org>
Run-TryBot: Roland Shoemaker <roland@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
import (
"context"
"fmt"
+ "internal/testenv"
"io/ioutil"
"os"
"os/exec"
}
func TestCommand(t *testing.T) {
+ testenv.MustHaveExec(t)
+
for _, cmd := range []func(string) *Cmd{
func(s string) *Cmd { return Command(s) },
func(s string) *Cmd { return CommandContext(context.Background(), s) },
}
func TestLookPath(t *testing.T) {
+ testenv.MustHaveExec(t)
+
tmpDir, err := ioutil.TempDir("", "execabs-test")
if err != nil {
t.Fatalf("ioutil.TempDir failed: %s", err)