From 28b2efcb190edd97b802ac9055eaf417f141f724 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 18 Mar 2016 11:37:31 +0100 Subject: tests: reenable basic auth test and add @ in username MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On launchpad #1558484 a user reports that @ in the authentication tokens parsing of sources.list isn't working in an older (precise) version. It isn't the recommended way of specifying passwords and co (auth.conf is), but we can at least test for regressions (and in this case test at all… who was that "clever" boy disabling a test with exit……… oh, nevermind. Git-Dch: Ignore --- test/libapt/uri_test.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'test/libapt') 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)); } -- cgit v1.2.3