diff options
| author | Sebastian Bauer <mail@sebastianbauer.info> | 2013-01-13 12:23:30 +0100 |
|---|---|---|
| committer | Sebastian Bauer <mail@sebastianbauer.info> | 2013-01-13 12:26:52 +0100 |
| commit | 5885ba112dd51c6446e500f72f92aebe5b872983 (patch) | |
| tree | 5b763ed48f5b89ed5c5c2186ba3d48bacbfbb012 /tests-clar/repo/init.c | |
| parent | 85f40312765f7d8df8d28a7dd61d7d5107071eeb (diff) | |
| download | libgit2-5885ba112dd51c6446e500f72f92aebe5b872983.tar.gz | |
Now checks in the template test whether the description file has
been properly copied.
This is a minimal effort to test whether the template really has
been used when creating an repo with external templates.
Diffstat (limited to 'tests-clar/repo/init.c')
| -rw-r--r-- | tests-clar/repo/init.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests-clar/repo/init.c b/tests-clar/repo/init.c index 09b25c13a..9ddb39545 100644 --- a/tests-clar/repo/init.c +++ b/tests-clar/repo/init.c @@ -365,6 +365,9 @@ void test_repo_init__extended_1(void) void test_repo_init__extended_with_template(void) { + git_buf expected = GIT_BUF_INIT; + git_buf actual = GIT_BUF_INIT; + git_repository_init_options opts = GIT_REPOSITORY_INIT_OPTIONS_INIT; opts.flags = GIT_REPOSITORY_INIT_MKPATH | GIT_REPOSITORY_INIT_BARE | GIT_REPOSITORY_INIT_EXTERNAL_TEMPLATE; @@ -375,6 +378,14 @@ void test_repo_init__extended_with_template(void) cl_assert(git_repository_is_bare(_repo)); cl_assert(!git__suffixcmp(git_repository_path(_repo), "/templated.git/")); + cl_assert(git_futils_readbuffer(&expected,cl_fixture("template/description")) == GIT_OK); + cl_assert(git_futils_readbuffer(&actual,"templated.git/description") == GIT_OK); + + cl_assert(!git_buf_cmp(&expected,&actual)); + + git_buf_free(&expected); + git_buf_free(&actual); + cleanup_repository("templated.git"); } |
