tests: add multivar read test

This commit is contained in:
Carlos Martín Nieto 2012-02-01 17:47:17 +01:00
parent 0774d94d31
commit 78d65f390f
2 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,24 @@
#include "clar_libgit2.h"
static int mv_read_cb(const char *name, const char *GIT_UNUSED(value), void *data)
{
int *n = (int *) data;
if (!strcmp(name, "remote.fancy.fetch"))
(*n)++;
return 0;
}
void test_config_multivar__foreach(void)
{
git_config *cfg;
int n = 0;
cl_git_pass(git_config_open_ondisk(&cfg, cl_fixture("config/config11")));
cl_git_pass(git_config_foreach(cfg, mv_read_cb, &n));
cl_assert(n == 2);
git_config_free(cfg);
}

Binary file not shown.