summaryrefslogtreecommitdiff
path: root/tests/network
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2014-08-31 17:16:40 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2014-08-31 21:50:28 +0200
commitba67c0752269ba06523fe7f5fa350e6328b20241 (patch)
treeecf846c692758ef9446cc29b148111ee168bcdc2 /tests/network
parentbd3854a09c9bd4196cf280108d3f6286ee6de258 (diff)
downloadlibgit2-ba67c0752269ba06523fe7f5fa350e6328b20241.tar.gz
remote: get rid of git_remote_valid_url()
It does the same as git_remote_supported_url() but has a name which implies we'd check the URL for correctness while we're simply looking at the scheme and looking it up in our lists. While here, fix up the tests so we check all the combination of what's supported.
Diffstat (limited to 'tests/network')
-rw-r--r--tests/network/remote/remotes.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/tests/network/remote/remotes.c b/tests/network/remote/remotes.c
index 21c57119a..1d5d318c5 100644
--- a/tests/network/remote/remotes.c
+++ b/tests/network/remote/remotes.c
@@ -91,25 +91,30 @@ void test_network_remote_remotes__error_when_no_push_available(void)
git_remote_free(r);
}
-void test_network_remote_remotes__parsing_ssh_remote(void)
+void test_network_remote_remotes__supported_transport_methods_are_supported(void)
{
- cl_assert( git_remote_valid_url("git@github.com:libgit2/libgit2.git") );
-}
+ cl_assert(git_remote_supported_url("git://github.com/libgit2/libgit2"));
+ cl_assert(git_remote_supported_url("http://github.com/libgit2/libgit2"));
-void test_network_remote_remotes__parsing_local_path_fails_if_path_not_found(void)
-{
- cl_assert( !git_remote_valid_url("/home/git/repos/libgit2.git") );
-}
+#ifdef GIT_SSH
+ cl_assert(git_remote_supported_url("git@github.com:libgit2/libgit2.git"));
+ cl_assert(git_remote_supported_url("ssh://git@github.com/libgit2/libgit2.git"));
+#endif
-void test_network_remote_remotes__supported_transport_methods_are_supported(void)
-{
- cl_assert( git_remote_supported_url("git://github.com/libgit2/libgit2") );
+#if defined(GIT_SSL) || defined(GIT_WINHTTP)
+ cl_assert(git_remote_supported_url("https://git@github.com/libgit2/libgit2.git"));
+#endif
}
void test_network_remote_remotes__unsupported_transport_methods_are_unsupported(void)
{
#ifndef GIT_SSH
- cl_assert( !git_remote_supported_url("git@github.com:libgit2/libgit2.git") );
+ cl_assert(!git_remote_supported_url("git@github.com:libgit2/libgit2.git"));
+ cl_assert(!git_remote_supported_url("ssh://git@github.com/libgit2/libgit2.git"));
+#endif
+
+#if !defined(GIT_SSL) && !defined(GIT_WINHTTP)
+ cl_assert(!git_remote_supported_url("https://git@github.com/libgit2/libgit2.git"));
#endif
}