Browse Source

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
Dave Cheney 11 years ago
parent
commit
1a6f1e67fb
1 changed files with 4 additions and 3 deletions
  1. 4 3
      ssh/session_test.go

+ 4 - 3
ssh/session_test.go

@@ -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)
 	}
 }