summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@github.com>2016-09-06 10:43:21 -0500
committerGitHub <noreply@github.com>2016-09-06 10:43:21 -0500
commit9ad07fc003f553f29f515c64073caea276eb3270 (patch)
treeb702e4594c1b56a1d9fe9acb78356a5d9b32d135 /tests
parent46035d984fc025d9acc0be2ffdeea21966b06aed (diff)
parentadedac5aba9e4525475fd59d751cd02c6f2b3a4f (diff)
downloadlibgit2-9ad07fc003f553f29f515c64073caea276eb3270.tar.gz
Merge pull request #3923 from libgit2/ethomson/diff-read-empty-binary
Read binary patches (with no binary data)
Diffstat (limited to 'tests')
-rw-r--r--tests/patch/patch_common.h5
-rw-r--r--tests/patch/print.c6
2 files changed, 11 insertions, 0 deletions
diff --git a/tests/patch/patch_common.h b/tests/patch/patch_common.h
index e097062d2..6ec554690 100644
--- a/tests/patch/patch_common.h
+++ b/tests/patch/patch_common.h
@@ -661,3 +661,8 @@
"\n" \
"delta 48\n" \
"mc$~Y)c#%<%fq{_;hPgsAGK(h)CJASj=y9P)1m{m|^9BI99|yz$\n\n"
+
+#define PATCH_BINARY_NOT_PRINTED \
+ "diff --git a/binary.bin b/binary.bin\n" \
+ "index 27184d9..7c94f9e 100644\n" \
+ "Binary files a/binary.bin and b/binary.bin differ\n"
diff --git a/tests/patch/print.c b/tests/patch/print.c
index 5a86573b3..62e50b93e 100644
--- a/tests/patch/print.c
+++ b/tests/patch/print.c
@@ -166,3 +166,9 @@ void test_patch_print__not_reversible(void)
patch_print_from_patchfile(PATCH_BINARY_NOT_REVERSIBLE,
strlen(PATCH_BINARY_NOT_REVERSIBLE));
}
+
+void test_patch_print__binary_not_shown(void)
+{
+ patch_print_from_patchfile(PATCH_BINARY_NOT_PRINTED,
+ strlen(PATCH_BINARY_NOT_PRINTED));
+}