From 1a6f1e67fb969f7e7242e84a75364517105b94c3 Mon Sep 17 00:00:00 2001 From: Dave Cheney Date: Sat, 1 Jun 2013 10:58:02 +1000 Subject: [PATCH] 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 --- ssh/session_test.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ssh/session_test.go b/ssh/session_test.go index 9588265..d168ce8 100644 --- a/ssh/session_test.go +++ b/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) } }