From 81fde0c9418a057ea83f9c7c286d866bd20cf692 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Wed, 28 Aug 2019 15:50:31 +0200 Subject: [PATCH] net/http: fix a long test after CL 185117 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The net/url error in question now quotes the URL, so update the expected output string. While at it, also update a comment in httputil, though that doesn't affect any test. Fixes #33910. Change-Id: I0981f528b24337c2952ef60c0db3b7ff72d72110 Reviewed-on: https://go-review.googlesource.com/c/go/+/192078 Run-TryBot: Daniel Martí Reviewed-by: Bryan C. Mills TryBot-Result: Gobot Gobot --- src/net/http/httputil/reverseproxy_test.go | 2 +- src/net/http/transport_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/net/http/httputil/reverseproxy_test.go b/src/net/http/httputil/reverseproxy_test.go index 7f9dc0800f..f58e08867f 100644 --- a/src/net/http/httputil/reverseproxy_test.go +++ b/src/net/http/httputil/reverseproxy_test.go @@ -436,7 +436,7 @@ func TestReverseProxyCancelation(t *testing.T) { } if err == nil { // This should be an error like: - // Get http://127.0.0.1:58079: read tcp 127.0.0.1:58079: + // Get "http://127.0.0.1:58079": read tcp 127.0.0.1:58079: // use of closed network connection t.Error("Server.Client().Do() returned nil error; want non-nil error") } diff --git a/src/net/http/transport_test.go b/src/net/http/transport_test.go index 23afff5d84..2ea26f7f66 100644 --- a/src/net/http/transport_test.go +++ b/src/net/http/transport_test.go @@ -2289,7 +2289,7 @@ func TestTransportCancelRequestInDial(t *testing.T) { got := logbuf.String() want := `dial: blocking canceling -Get = Get http://something.no-network.tld/: net/http: request canceled while waiting for connection +Get = Get "http://something.no-network.tld/": net/http: request canceled while waiting for connection ` if got != want { t.Errorf("Got events:\n%s\nWant:\n%s", got, want)