diff options
author | David Kalnischkies <david@kalnischkies.de> | 2016-08-01 21:45:29 +0200 |
---|---|---|
committer | Julian Andres Klode <jak@debian.org> | 2016-10-05 21:53:37 +0200 |
commit | e5f2e875e53cf03112dda0ac72ab252ca9b2b377 (patch) | |
tree | 8e43a6c85d330cfb685a941abafdff9810461b4c /test | |
parent | 6c36aa231b8dcde3b4698157a1ed1e7e4054a0ea (diff) |
allow user@host (aka: no password) in URI parsing
If the URI had no password the username was ignored
(cherry picked from commit a1f3ac8aba0675321dd46d074af8abcbb10c19fd)
Diffstat (limited to 'test')
-rw-r--r-- | test/libapt/uri_test.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/libapt/uri_test.cc b/test/libapt/uri_test.cc index d8f3ffe45..8296ca6a0 100644 --- a/test/libapt/uri_test.cc +++ b/test/libapt/uri_test.cc @@ -28,6 +28,18 @@ TEST(URITest, BasicHTTP) EXPECT_EQ("http://ualberta.ca", URI::SiteOnly(U)); EXPECT_EQ("http://ualberta.ca/blah", URI::ArchiveOnly(U)); EXPECT_EQ("http://ualberta.ca/blah", URI::NoUserPassword(U)); + // just a user + U = URI("https://apt@example.org/blah"); + EXPECT_EQ("https", U.Access); + EXPECT_EQ("apt", U.User); + EXPECT_EQ("", U.Password); + EXPECT_EQ(0, U.Port); + EXPECT_EQ("example.org", U.Host); + EXPECT_EQ("/blah", U.Path); + EXPECT_EQ("https://apt@example.org/blah", (std::string)U); + EXPECT_EQ("https://example.org", URI::SiteOnly(U)); + EXPECT_EQ("https://example.org/blah", URI::ArchiveOnly(U)); + EXPECT_EQ("https://example.org/blah", URI::NoUserPassword(U)); } TEST(URITest, SingeSlashFile) { |