mirror of
https://git.proxmox.com/git/libgit2
synced 2025-08-11 19:58:02 +00:00
Add tests for badly-formed URLs
This commit is contained in:
parent
f93f3790c5
commit
7be5104d24
@ -56,13 +56,9 @@ void test_clone_nonetwork__bad_urls(void)
|
|||||||
cl_assert(!git_path_exists("./foo"));
|
cl_assert(!git_path_exists("./foo"));
|
||||||
|
|
||||||
cl_git_fail(git_clone(&g_repo, "git://example.com:asdf", "./foo", &g_options));
|
cl_git_fail(git_clone(&g_repo, "git://example.com:asdf", "./foo", &g_options));
|
||||||
cl_assert(!git_path_exists("./foo"));
|
|
||||||
cl_git_fail(git_clone(&g_repo, "git://example.com:asdf/foo", "./foo", &g_options));
|
|
||||||
cl_assert(!git_path_exists("./foo"));
|
|
||||||
cl_git_fail(git_clone(&g_repo, "https://example.com:asdf", "./foo", &g_options));
|
|
||||||
cl_assert(!git_path_exists("./foo"));
|
|
||||||
cl_git_fail(git_clone(&g_repo, "https://example.com:asdf/foo", "./foo", &g_options));
|
cl_git_fail(git_clone(&g_repo, "https://example.com:asdf/foo", "./foo", &g_options));
|
||||||
cl_assert(!git_path_exists("./foo"));
|
cl_git_fail(git_clone(&g_repo, "git://github.com/git://github.com/foo/bar.git.git",
|
||||||
|
"./bar", &g_options));
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_clone_nonetwork__do_not_clean_existing_directory(void)
|
void test_clone_nonetwork__do_not_clean_existing_directory(void)
|
||||||
|
@ -31,6 +31,13 @@ void test_network_urlparse__trivial(void)
|
|||||||
cl_assert_equal_p(pass, NULL);
|
cl_assert_equal_p(pass, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void test_network_urlparse__bad_url(void)
|
||||||
|
{
|
||||||
|
cl_git_fail_with(gitno_extract_url_parts(&host, &port, &user, &pass,
|
||||||
|
"github.com/git://github.com/foo/bar.git.git", "443"),
|
||||||
|
GIT_EINVALIDSPEC);
|
||||||
|
}
|
||||||
|
|
||||||
void test_network_urlparse__user(void)
|
void test_network_urlparse__user(void)
|
||||||
{
|
{
|
||||||
cl_git_pass(gitno_extract_url_parts(&host, &port, &user, &pass,
|
cl_git_pass(gitno_extract_url_parts(&host, &port, &user, &pass,
|
||||||
|
Loading…
Reference in New Issue
Block a user