diff options
| author | Leon Klingele <git@leonklingele.de> | 2019-11-05 16:19:42 +0000 |
|---|---|---|
| committer | Brad Fitzpatrick <bradfitz@golang.org> | 2019-11-11 21:56:37 +0000 |
| commit | ee706cfe83ec1bbb95e7ebe29c640544510c732b (patch) | |
| tree | 8eafc12e7271dbc9adb306b9370dfbf18efef39c /src | |
| parent | d43180429552dd09ba98f1af7bd25c245cf8531e (diff) | |
| download | go-ee706cfe83ec1bbb95e7ebe29c640544510c732b.tar.xz | |
net/smtp: add missing error check in test
Change-Id: Ifcbd9d2961073a18a250f052180248d9bf223e97
GitHub-Last-Rev: 67f97d1ca07665979504264986e25522ed6799f8
GitHub-Pull-Request: golang/go#30018
Reviewed-on: https://go-review.googlesource.com/c/go/+/160442
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src')
| -rw-r--r-- | src/net/smtp/smtp_test.go | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/net/smtp/smtp_test.go b/src/net/smtp/smtp_test.go index 2ad7dd0978..cfda0790e9 100644 --- a/src/net/smtp/smtp_test.go +++ b/src/net/smtp/smtp_test.go @@ -656,9 +656,16 @@ func TestSendMailWithAuth(t *testing.T) { tc := textproto.NewConn(conn) tc.PrintfLine("220 hello world") msg, err := tc.ReadLine() - if msg == "EHLO localhost" { - tc.PrintfLine("250 mx.google.com at your service") + if err != nil { + errCh <- fmt.Errorf("ReadLine error: %v", err) + return + } + const wantMsg = "EHLO localhost" + if msg != wantMsg { + errCh <- fmt.Errorf("unexpected response %q; want %q", msg, wantMsg) + return } + err = tc.PrintfLine("250 mx.google.com at your service") if err != nil { errCh <- fmt.Errorf("PrintfLine: %v", err) return |
