go.crypto/ssh: fix test breakage

Followup CL for 9711043. The order that CombinedOutput returns data captured from stdout/stderr is not specified, so we have to test both variants.

Thanks to fullung for the bug report.

R=fullung, kr
CC=golang-dev
https://golang.org/cl/9921044
This commit is contained in:
Dave Cheney
2013-06-01 10:58:02 +10:00
parent 0e971cde33
commit 1a6f1e67fb
+4 -3
View File
@@ -177,11 +177,12 @@ func TestSessionCombinedOutput(t *testing.T) {
if err != nil {
t.Error("Remote command did not exit cleanly:", err)
}
w := "this-is-stdout.this-is-stderr."
const stdout = "this-is-stdout."
const stderr = "this-is-stderr."
g := string(buf)
if g != w {
if g != stdout+stderr && g != stderr+stdout {
t.Error("Remote command did not return expected string:")
t.Logf("want %q", w)
t.Logf("want %q, or %q", stdout+stderr, stderr+stdout)
t.Logf("got %q", g)
}
}