From 1782038144ef3413831801bb9c2f3038a84ac6f4 Mon Sep 17 00:00:00 2001 From: Ben Straub Date: Thu, 14 Nov 2013 14:05:52 -0800 Subject: Rename tests-clar to tests --- tests/repo/shallow.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 tests/repo/shallow.c (limited to 'tests/repo/shallow.c') diff --git a/tests/repo/shallow.c b/tests/repo/shallow.c new file mode 100644 index 000000000..1cc66ae40 --- /dev/null +++ b/tests/repo/shallow.c @@ -0,0 +1,33 @@ +#include "clar_libgit2.h" +#include "fileops.h" + +static git_repository *g_repo; + +void test_repo_shallow__initialize(void) +{ +} + +void test_repo_shallow__cleanup(void) +{ + cl_git_sandbox_cleanup(); +} + +void test_repo_shallow__no_shallow_file(void) +{ + g_repo = cl_git_sandbox_init("testrepo.git"); + cl_assert_equal_i(0, git_repository_is_shallow(g_repo)); +} + +void test_repo_shallow__empty_shallow_file(void) +{ + g_repo = cl_git_sandbox_init("testrepo.git"); + cl_git_mkfile("testrepo.git/shallow", ""); + cl_assert_equal_i(0, git_repository_is_shallow(g_repo)); +} + +void test_repo_shallow__shallow_repo(void) +{ + g_repo = cl_git_sandbox_init("shallow.git"); + cl_assert_equal_i(1, git_repository_is_shallow(g_repo)); +} + -- cgit v1.2.1