go.tools/oracle: fix TestOracle on Plan 9

LGTM=minux.ma
R=golang-codereviews, lucio.dere, gobot, minux.ma
CC=golang-codereviews
https://golang.org/cl/64400043
This commit is contained in:
David du Colombier 2014-02-21 21:53:57 +01:00
parent 99b2441d95
commit 29d0463c1c
1 changed files with 7 additions and 1 deletions

View File

@ -242,7 +242,13 @@ func TestOracle(t *testing.T) {
} }
// Compare foo.got with foo.golden. // Compare foo.got with foo.golden.
cmd := exec.Command("/usr/bin/diff", "-u", golden, got) // assumes POSIX var cmd *exec.Cmd
switch runtime.GOOS {
case "plan9":
cmd = exec.Command("/bin/diff", "-c", golden, got)
default:
cmd = exec.Command("/usr/bin/diff", "-u", golden, got)
}
buf := new(bytes.Buffer) buf := new(bytes.Buffer)
cmd.Stdout = buf cmd.Stdout = buf
if err := cmd.Run(); err != nil { if err := cmd.Run(); err != nil {