mirror of https://github.com/golang/go.git
os/exec: pass ExitCode tests on Plan 9
Fixes #27294 Change-Id: I8db5ca0f0c690bf532d3d33b8ed7d2633ad1702b Reviewed-on: https://go-review.googlesource.com/131855 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
975f1afd85
commit
2e234754d7
|
|
@ -173,6 +173,9 @@ func TestExitCode(t *testing.T) {
|
|||
cmd := helperCommand(t, "exit", "42")
|
||||
cmd.Run()
|
||||
want := 42
|
||||
if runtime.GOOS == "plan9" {
|
||||
want = 1
|
||||
}
|
||||
got := cmd.ProcessState.ExitCode()
|
||||
if want != got {
|
||||
t.Errorf("ExitCode got %d, want %d", got, want)
|
||||
|
|
@ -181,6 +184,9 @@ func TestExitCode(t *testing.T) {
|
|||
cmd = helperCommand(t, "/no-exist-executable")
|
||||
cmd.Run()
|
||||
want = 2
|
||||
if runtime.GOOS == "plan9" {
|
||||
want = 1
|
||||
}
|
||||
got = cmd.ProcessState.ExitCode()
|
||||
if want != got {
|
||||
t.Errorf("ExitCode got %d, want %d", got, want)
|
||||
|
|
@ -189,6 +195,9 @@ func TestExitCode(t *testing.T) {
|
|||
cmd = helperCommand(t, "exit", "255")
|
||||
cmd.Run()
|
||||
want = 255
|
||||
if runtime.GOOS == "plan9" {
|
||||
want = 1
|
||||
}
|
||||
got = cmd.ProcessState.ExitCode()
|
||||
if want != got {
|
||||
t.Errorf("ExitCode got %d, want %d", got, want)
|
||||
|
|
|
|||
Loading…
Reference in New Issue