summaryrefslogtreecommitdiff
path: root/test/libapt
diff options
context:
space:
mode:
Diffstat (limited to 'test/libapt')
-rw-r--r--test/libapt/uri_test.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/libapt/uri_test.cc b/test/libapt/uri_test.cc
index fe6015e65..d8f3ffe45 100644
--- a/test/libapt/uri_test.cc
+++ b/test/libapt/uri_test.cc
@@ -159,7 +159,7 @@ TEST(URITest, RFC2732)
EXPECT_EQ("cdrom://Foo Bar Cow", URI::SiteOnly(U));
EXPECT_EQ("cdrom://Foo Bar Cow/debian", URI::ArchiveOnly(U));
EXPECT_EQ("cdrom://Foo Bar Cow/debian/", URI::NoUserPassword(U));
- // percent encoded
+ // percent encoded password
U = URI("ftp://foo:b%40r@example.org");
EXPECT_EQ("foo", U.User);
EXPECT_EQ("b@r", U.Password);
@@ -167,4 +167,12 @@ TEST(URITest, RFC2732)
EXPECT_EQ("ftp://example.org", URI::SiteOnly(U));
EXPECT_EQ("ftp://example.org", URI::ArchiveOnly(U));
EXPECT_EQ("ftp://example.org/", URI::NoUserPassword(U));
+ // percent encoded user
+ U = URI("ftp://f%40o:bar@example.org");
+ EXPECT_EQ("f@o", U.User);
+ EXPECT_EQ("bar", U.Password);
+ EXPECT_EQ("ftp://f%40o:bar@example.org/", (std::string) U);
+ EXPECT_EQ("ftp://example.org", URI::SiteOnly(U));
+ EXPECT_EQ("ftp://example.org", URI::ArchiveOnly(U));
+ EXPECT_EQ("ftp://example.org/", URI::NoUserPassword(U));
}