diff options
Diffstat (limited to 'tests/patch')
-rw-r--r-- | tests/patch/parse.c | 14 | ||||
-rw-r--r-- | tests/patch/patch_common.h | 12 |
2 files changed, 26 insertions, 0 deletions
diff --git a/tests/patch/parse.c b/tests/patch/parse.c index 9067f4a9d..c18b63ab7 100644 --- a/tests/patch/parse.c +++ b/tests/patch/parse.c @@ -156,6 +156,20 @@ void test_patch_parse__binary_file_with_missing_paths(void) strlen(PATCH_BINARY_FILE_WITH_MISSING_PATHS), NULL)); } +void test_patch_parse__binary_file_with_whitespace_paths(void) +{ + git_patch *patch; + cl_git_fail(git_patch_from_buffer(&patch, PATCH_BINARY_FILE_WITH_WHITESPACE_PATHS, + strlen(PATCH_BINARY_FILE_WITH_WHITESPACE_PATHS), NULL)); +} + +void test_patch_parse__binary_file_with_empty_quoted_paths(void) +{ + git_patch *patch; + cl_git_fail(git_patch_from_buffer(&patch, PATCH_BINARY_FILE_WITH_QUOTED_EMPTY_PATHS, + strlen(PATCH_BINARY_FILE_WITH_QUOTED_EMPTY_PATHS), NULL)); +} + void test_patch_parse__memory_leak_on_multiple_paths(void) { git_patch *patch; diff --git a/tests/patch/patch_common.h b/tests/patch/patch_common.h index 153bab57f..4f2141dbe 100644 --- a/tests/patch/patch_common.h +++ b/tests/patch/patch_common.h @@ -912,6 +912,18 @@ "+++ \n" \ "Binary files " +#define PATCH_BINARY_FILE_WITH_WHITESPACE_PATHS \ + "diff --git a/file b/file\n" \ + "--- \n" \ + "+++ \n" \ + "Binary files " + +#define PATCH_BINARY_FILE_WITH_QUOTED_EMPTY_PATHS \ + "diff --git a/file b/file\n" \ + "--- \"\"\n" \ + "+++ \"\"\n" \ + "Binary files " + #define PATCH_MULTIPLE_OLD_PATHS \ "diff --git \n" \ "--- \n" \ |