diff options
| author | Vicent Marti <vicent@github.com> | 2014-07-03 02:41:10 +0200 |
|---|---|---|
| committer | Vicent Marti <vicent@github.com> | 2014-07-03 02:41:10 +0200 |
| commit | 193fe9cbbfd911e240f6d4ab7fed3ec96f35c657 (patch) | |
| tree | 87b81c59958f63ff3a0fdd6e21cdb8831e3cf872 /tests | |
| parent | cb6e68c7e6dc2b87f742f0ea24704fe38d007578 (diff) | |
| parent | 1380e7c6b1b802efdbbe48edf706e49cc309f370 (diff) | |
| download | libgit2-193fe9cbbfd911e240f6d4ab7fed3ec96f35c657.tar.gz | |
Merge pull request #2459 from libgit2/cmn/http-url-path
netops: error out on url without a path
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/network/urlparse.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/network/urlparse.c b/tests/network/urlparse.c index 2a9c2f69f..b3ac8ae60 100644 --- a/tests/network/urlparse.c +++ b/tests/network/urlparse.c @@ -33,6 +33,24 @@ void test_network_urlparse__trivial(void) cl_assert_equal_p(pass, NULL); } +void test_network_urlparse__root(void) +{ + cl_git_pass(gitno_extract_url_parts(&host, &port, &path, &user, &pass, + "http://example.com/", "8080")); + cl_assert_equal_s(host, "example.com"); + cl_assert_equal_s(port, "8080"); + cl_assert_equal_s(path, "/"); + cl_assert_equal_p(user, NULL); + cl_assert_equal_p(pass, NULL); +} + +void test_network_urlparse__just_hostname(void) +{ + cl_git_fail_with(GIT_EINVALIDSPEC, + gitno_extract_url_parts(&host, &port, &path, &user, &pass, + "http://example.com", "8080")); +} + void test_network_urlparse__encoded_password(void) { cl_git_pass(gitno_extract_url_parts(&host, &port, &path, &user, &pass, |
