diff options
Diffstat (limited to 'libgo/go/exp/ssh/transport_test.go')
-rw-r--r-- | libgo/go/exp/ssh/transport_test.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libgo/go/exp/ssh/transport_test.go b/libgo/go/exp/ssh/transport_test.go index 9a610a7..b2e2a7f 100644 --- a/libgo/go/exp/ssh/transport_test.go +++ b/libgo/go/exp/ssh/transport_test.go @@ -12,9 +12,9 @@ import ( func TestReadVersion(t *testing.T) { buf := []byte(serverVersion) - result, ok := readVersion(bufio.NewReader(bytes.NewBuffer(buf))) - if !ok { - t.Error("readVersion didn't read version correctly") + result, err := readVersion(bufio.NewReader(bytes.NewBuffer(buf))) + if err != nil { + t.Errorf("readVersion didn't read version correctly: %s", err) } if !bytes.Equal(buf[:len(buf)-2], result) { t.Error("version read did not match expected") @@ -23,7 +23,7 @@ func TestReadVersion(t *testing.T) { func TestReadVersionTooLong(t *testing.T) { buf := make([]byte, maxVersionStringBytes+1) - if _, ok := readVersion(bufio.NewReader(bytes.NewBuffer(buf))); ok { + if _, err := readVersion(bufio.NewReader(bytes.NewBuffer(buf))); err == nil { t.Errorf("readVersion consumed %d bytes without error", len(buf)) } } @@ -31,7 +31,7 @@ func TestReadVersionTooLong(t *testing.T) { func TestReadVersionWithoutCRLF(t *testing.T) { buf := []byte(serverVersion) buf = buf[:len(buf)-1] - if _, ok := readVersion(bufio.NewReader(bytes.NewBuffer(buf))); ok { + if _, err := readVersion(bufio.NewReader(bytes.NewBuffer(buf))); err == nil { t.Error("readVersion did not notice \\n was missing") } } |