diff options
author | Matthew Bauer <mjbauer95@gmail.com> | 2021-06-25 15:51:02 -0500 |
---|---|---|
committer | Matthew Bauer <mjbauer95@gmail.com> | 2021-06-25 15:51:02 -0500 |
commit | c3a929349f6c1968285ffff735933772be2f77cb (patch) | |
tree | 0bfcfa57bf200461821a4239fe316a00f377a792 /src/libutil/tests/url.cc | |
parent | d5fd0f4745d834f7ac7049a0eb7e212ce9c7ef47 (diff) | |
parent | bf68c693dc5157c2be1f3a9f407dd1ce3761df78 (diff) |
Merge remote-tracking branch 'origin/master' into cross-jobs
Diffstat (limited to 'src/libutil/tests/url.cc')
-rw-r--r-- | src/libutil/tests/url.cc | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/libutil/tests/url.cc b/src/libutil/tests/url.cc index 80646ad3e..aff58e9ee 100644 --- a/src/libutil/tests/url.cc +++ b/src/libutil/tests/url.cc @@ -117,6 +117,24 @@ namespace nix { ASSERT_EQ(parsed, expected); } + TEST(parseURL, parseScopedRFC4007IPv6Address) { + auto s = "http://[fe80::818c:da4d:8975:415c\%enp0s25]:8080"; + auto parsed = parseURL(s); + + ParsedURL expected { + .url = "http://[fe80::818c:da4d:8975:415c\%enp0s25]:8080", + .base = "http://[fe80::818c:da4d:8975:415c\%enp0s25]:8080", + .scheme = "http", + .authority = "[fe80::818c:da4d:8975:415c\%enp0s25]:8080", + .path = "", + .query = (StringMap) { }, + .fragment = "", + }; + + ASSERT_EQ(parsed, expected); + + } + TEST(parseURL, parseIPv6Address) { auto s = "http://[2a02:8071:8192:c100:311d:192d:81ac:11ea]:8080"; auto parsed = parseURL(s); |