Skip to content

Commit

Permalink
registryurl: use designated domains in tests (RFC2606)
Browse files Browse the repository at this point in the history
Update domains used in tests to used domains that are designated for this
purpose as described in [RFC2606, section 3][1]

[1]: https://www.rfc-editor.org/rfc/rfc2606.html#section-3

Signed-off-by: Sebastiaan van Stijn <[email protected]>
  • Loading branch information
thaJeztah committed Jun 26, 2023
1 parent 4977273 commit 91af1de
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions registryurl/parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,39 +14,39 @@ func TestHelperParseURL(t *testing.T) {
err error
}{
{
url: "foobar.docker.io",
expectedURL: "//foobar.docker.io",
url: "foobar.example.com",
expectedURL: "//foobar.example.com",
},
{
url: "foobar.docker.io:2376",
expectedURL: "//foobar.docker.io:2376",
url: "foobar.example.com:2376",
expectedURL: "//foobar.example.com:2376",
},
{
url: "//foobar.docker.io:2376",
expectedURL: "//foobar.docker.io:2376",
url: "//foobar.example.com:2376",
expectedURL: "//foobar.example.com:2376",
},
{
url: "http://foobar.docker.io:2376",
expectedURL: "http://foobar.docker.io:2376",
url: "http://foobar.example.com:2376",
expectedURL: "http://foobar.example.com:2376",
},
{
url: "https://foobar.docker.io:2376",
expectedURL: "https://foobar.docker.io:2376",
url: "https://foobar.example.com:2376",
expectedURL: "https://foobar.example.com:2376",
},
{
url: "https://foobar.docker.io:2376/some/path",
expectedURL: "https://foobar.docker.io:2376/some/path",
url: "https://foobar.example.com:2376/some/path",
expectedURL: "https://foobar.example.com:2376/some/path",
},
{
url: "https://foobar.docker.io:2376/some/other/path?foo=bar",
expectedURL: "https://foobar.docker.io:2376/some/other/path",
url: "https://foobar.example.com:2376/some/other/path?foo=bar",
expectedURL: "https://foobar.example.com:2376/some/other/path",
},
{
url: "/foobar.docker.io",
url: "/foobar.example.com",
err: errors.New("no hostname in URL"),
},
{
url: "ftp://foobar.docker.io:2376",
url: "ftp://foobar.example.com:2376",
err: errors.New("unsupported scheme: ftp"),
},
}
Expand Down

0 comments on commit 91af1de

Please sign in to comment.