Skip to content

Commit ffef8e0

Browse files
committed
url: test that we don't expand % encoding in paths
1 parent fb6c86a commit ffef8e0

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/util/url/parse.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -555,3 +555,15 @@ void test_url_parse__ipv6_invalid_addresses(void)
555555
/* Invalid character inside address */
556556
cl_git_fail_with(GIT_EINVALIDSPEC, git_net_url_parse(&conndata, "http://[fe8o::dcad:beff:fe00:0001]/resource"));
557557
}
558+
559+
void test_url_parse__spaces_in_the_name(void)
560+
{
561+
cl_git_pass(git_net_url_parse(&conndata, "https://libgit2@dev.azure.com/libgit2/test/_git/spaces%20in%20the%20name"));
562+
cl_assert_equal_s(conndata.scheme, "https");
563+
cl_assert_equal_s(conndata.host, "dev.azure.com");
564+
cl_assert_equal_s(conndata.port, "443");
565+
cl_assert_equal_s(conndata.path, "/libgit2/test/_git/spaces%20in%20the%20name");
566+
cl_assert_equal_s(conndata.username, "libgit2");
567+
cl_assert_equal_p(conndata.password, NULL);
568+
cl_assert_equal_i(git_net_url_is_default_port(&conndata), 1);
569+
}

0 commit comments

Comments
 (0)