aboutsummaryrefslogtreecommitdiff
path: root/src/os/exec/exec_test.go
diff options
context:
space:
mode:
authorFazlul Shahriar <fshahriar@gmail.com>2018-08-28 09:55:43 -0400
committerBrad Fitzpatrick <bradfitz@golang.org>2018-08-28 14:10:31 +0000
commit2e234754d7aee07eb00c7133a331e96a75517f9e (patch)
tree1f0dd21b6169e186e57a74e6bc0e8135893d25af /src/os/exec/exec_test.go
parent975f1afd85bd1de6037e1ba30af0c7ec598f689c (diff)
downloadgo-2e234754d7aee07eb00c7133a331e96a75517f9e.tar.gz
go-2e234754d7aee07eb00c7133a331e96a75517f9e.zip
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>
Diffstat (limited to 'src/os/exec/exec_test.go')
-rw-r--r--src/os/exec/exec_test.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/os/exec/exec_test.go b/src/os/exec/exec_test.go
index f0bba11c5a..558345ff63 100644
--- a/src/os/exec/exec_test.go
+++ b/src/os/exec/exec_test.go
@@ -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)