Skip to content

Commit f778af6

Browse files
committed
tests: git_remote_create_anonymous
1 parent fa69195 commit f778af6

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

tests/remote/create.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,3 +125,24 @@ void test_remote_create__with_fetchspec_invalid_url(void)
125125
{
126126
cl_git_assert_cannot_create_remote(GIT_EINVALIDSPEC, git_remote_create_with_fetchspec(&r, _repo, NULL, "", NULL));
127127
}
128+
129+
void test_remote_create__anonymous(void)
130+
{
131+
git_remote *remote;
132+
git_strarray array;
133+
134+
cl_git_pass(git_remote_create_anonymous(&remote, _repo, TEST_URL));
135+
cl_assert_equal_s(git_remote_name(remote), NULL);
136+
cl_assert_equal_s(git_remote_url(remote), TEST_URL);
137+
138+
cl_git_pass(git_remote_get_fetch_refspecs(&array, remote));
139+
cl_assert_equal_i(0, array.count);
140+
141+
git_strarray_free(&array);
142+
git_remote_free(remote);
143+
}
144+
145+
void test_remote_create__anonymous_invalid_url(void)
146+
{
147+
cl_git_assert_cannot_create_remote(GIT_EINVALIDSPEC, git_remote_create_anonymous(&r, _repo, ""));
148+
}

0 commit comments

Comments
 (0)