Test more kinds of bad url

This commit is contained in:
Ben Straub 2013-10-30 18:54:39 -07:00
parent 29b77446b7
commit ff0ef88c5b

View File

@ -46,7 +46,7 @@ void test_clone_nonetwork__cleanup(void)
cl_fixture_cleanup("./foo");
}
void test_clone_nonetwork__bad_url(void)
void test_clone_nonetwork__bad_urls(void)
{
/* Clone should clean up the mess if the URL isn't a git repository */
cl_git_fail(git_clone(&g_repo, "not_a_repo", "./foo", &g_options));
@ -54,6 +54,15 @@ void test_clone_nonetwork__bad_url(void)
g_options.bare = true;
cl_git_fail(git_clone(&g_repo, "not_a_repo", "./foo", &g_options));
cl_assert(!git_path_exists("./foo"));
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_assert(!git_path_exists("./foo"));
}
void test_clone_nonetwork__do_not_clean_existing_directory(void)