inmemory.c 474 Bytes
Newer Older
1 2 3 4 5 6 7
#include "clar_libgit2.h"

void test_index_inmemory__can_create_an_inmemory_index(void)
{
	git_index *index;

	cl_git_pass(git_index_new(&index));
8
	cl_assert_equal_i(0, (int)git_index_entrycount(index));
9 10 11

	git_index_free(index);
}
12 13 14 15 16 17 18 19 20 21 22

void test_index_inmemory__cannot_add_from_workdir_to_an_inmemory_index(void)
{
	git_index *index;

	cl_git_pass(git_index_new(&index));

	cl_assert_equal_i(GIT_ERROR, git_index_add_from_workdir(index, "test.txt"));

	git_index_free(index);
}