Commit 76633215 by Carlos Martín Nieto

binary diff: test that the diff and patch otputs are the same

We test the generation of the textual patch via the patch function,
which are just one of two possibilities to get the output.

Add a second patch generation via the diff function to make sure both
outputs are in sync.
parent aacfd03d
#include "clar_libgit2.h"
#include "git2/sys/diff.h"
#include "buffer.h"
#include "filebuf.h"
......@@ -49,6 +51,11 @@ void test_patch(
cl_assert_equal_s(expected, actual.ptr);
git_buf_clear(&actual);
cl_git_pass(git_diff_print(diff, GIT_DIFF_FORMAT_PATCH, git_diff_print_callback__to_buf, &actual));
cl_assert_equal_s(expected, actual.ptr);
git_buf_free(&actual);
git_patch_free(patch);
git_diff_free(diff);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment