]> Cypherpunks repositories - gostls13.git/commitdiff
net/url: add test case to ResolveReference
authorkami-sama <kamisamakirishima@gmail.com>
Wed, 4 Feb 2026 08:24:56 +0000 (13:54 +0530)
committerGopher Robot <gobot@golang.org>
Fri, 6 Feb 2026 23:34:01 +0000 (15:34 -0800)
This adds a test case to resolveReferenceTests to ensure that a
relative path is correctly appended to a base URL that ends with a
trailing slash.

Change-Id: I94ea65355bb96f23acff09a3992c9dcf6e47da60
Reviewed-on: https://go-review.googlesource.com/c/go/+/741880
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Michael Pratt <mpratt@google.com>

src/net/url/url_test.go

index d099353eb2618cce57e13c7ce8140471ba8ec187..9ba2a1231dd764ddf2da77a5e7e2ec1e3d155183 100644 (file)
@@ -1209,6 +1209,7 @@ var resolveReferenceTests = []struct {
        {"http://foo.com", "bar", "http://foo.com/bar"},
        {"http://foo.com/", "bar", "http://foo.com/bar"},
        {"http://foo.com/bar/baz", "quux", "http://foo.com/bar/quux"},
+       {"http://foo.com/bar/baz/", "quux", "http://foo.com/bar/baz/quux"},
 
        // ... going up
        {"http://foo.com/bar/baz", "../quux", "http://foo.com/quux"},