summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2022-06-17 13:27:45 -0400
committerEdward Thomson <ethomson@edwardthomson.com>2022-06-17 13:49:34 -0400
commitffef8e01d3a2d7802d32d452f123fd2b97af3d38 (patch)
tree2696f6f0a9e125695cda15feb55aef6548d28802 /tests
parentfb6c86a2449e9ec5e8c1c06e0be88e97004c7573 (diff)
downloadlibgit2-ffef8e01d3a2d7802d32d452f123fd2b97af3d38.tar.gz
url: test that we don't expand % encoding in paths
Diffstat (limited to 'tests')
-rw-r--r--tests/util/url/parse.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/util/url/parse.c b/tests/util/url/parse.c
index 1206aa381..5b6116e28 100644
--- a/tests/util/url/parse.c
+++ b/tests/util/url/parse.c
@@ -555,3 +555,15 @@ void test_url_parse__ipv6_invalid_addresses(void)
/* Invalid character inside address */
cl_git_fail_with(GIT_EINVALIDSPEC, git_net_url_parse(&conndata, "http://[fe8o::dcad:beff:fe00:0001]/resource"));
}
+
+void test_url_parse__spaces_in_the_name(void)
+{
+ cl_git_pass(git_net_url_parse(&conndata, "https://libgit2@dev.azure.com/libgit2/test/_git/spaces%20in%20the%20name"));
+ cl_assert_equal_s(conndata.scheme, "https");
+ cl_assert_equal_s(conndata.host, "dev.azure.com");
+ cl_assert_equal_s(conndata.port, "443");
+ cl_assert_equal_s(conndata.path, "/libgit2/test/_git/spaces%20in%20the%20name");
+ cl_assert_equal_s(conndata.username, "libgit2");
+ cl_assert_equal_p(conndata.password, NULL);
+ cl_assert_equal_i(git_net_url_is_default_port(&conndata), 1);
+}