diff options
| author | Etienne Samson <samson.etienne@gmail.com> | 2018-06-20 02:26:52 +0200 |
|---|---|---|
| committer | Etienne Samson <samson.etienne@gmail.com> | 2018-11-02 14:58:02 +0100 |
| commit | fa69195e99256c216bfed9f5c33179e9db4ca2ab (patch) | |
| tree | bfaa9c6f3c7907550dcea7e285edaaf5288dd6c8 /tests/remote | |
| parent | 10fa2dd61c383e1d920a78cc12aa72f6e0bf7b65 (diff) | |
| download | libgit2-fa69195e99256c216bfed9f5c33179e9db4ca2ab.tar.gz | |
tests: git_remote_create_with_fetchspec
Diffstat (limited to 'tests/remote')
| -rw-r--r-- | tests/remote/create.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/remote/create.c b/tests/remote/create.c index 79e5d3f86..a7e7a72c3 100644 --- a/tests/remote/create.c +++ b/tests/remote/create.c @@ -102,3 +102,26 @@ void test_remote_create__with_fetchspec(void) git_strarray_free(&array); git_remote_free(remote); } + +void test_remote_create__with_empty_fetchspec(void) +{ + git_remote *remote; + git_strarray array; + + cl_git_pass(git_remote_create_with_fetchspec(&remote, _repo, "test-new", "git://github.com/libgit2/libgit2", NULL)); + cl_git_pass(git_remote_get_fetch_refspecs(&array, remote)); + cl_assert_equal_i(0, array.count); + + git_strarray_free(&array); + git_remote_free(remote); +} + +void test_remote_create__with_fetchspec_invalid_name(void) +{ + cl_git_assert_cannot_create_remote(GIT_EINVALIDSPEC, git_remote_create_with_fetchspec(&r, _repo, NULL, TEST_URL, NULL)); +} + +void test_remote_create__with_fetchspec_invalid_url(void) +{ + cl_git_assert_cannot_create_remote(GIT_EINVALIDSPEC, git_remote_create_with_fetchspec(&r, _repo, NULL, "", NULL)); +} |
