diff options
Diffstat (limited to 'tests-clar/status')
| -rw-r--r-- | tests-clar/status/status_data.h | 50 | ||||
| -rw-r--r-- | tests-clar/status/worktree.c | 10 |
2 files changed, 58 insertions, 2 deletions
diff --git a/tests-clar/status/status_data.h b/tests-clar/status/status_data.h index 85a7cd6b5..a41bde7c2 100644 --- a/tests-clar/status/status_data.h +++ b/tests-clar/status/status_data.h @@ -90,6 +90,56 @@ static const int entry_count2 = 15; /* entries for a copy of tests/resources/status with some mods */ +static const char *entry_paths3_icase[] = { + ".HEADER", + "42-is-not-prime.sigh", + "current_file", + "current_file/", + "file_deleted", + "ignored_file", + "modified_file", + "new_file", + "README.md", + "staged_changes", + "staged_changes_file_deleted", + "staged_changes_modified_file", + "staged_delete_file_deleted", + "staged_delete_modified_file", + "staged_new_file", + "staged_new_file_deleted_file", + "staged_new_file_modified_file", + "subdir", + "subdir/current_file", + "subdir/deleted_file", + "subdir/modified_file", + "\xe8\xbf\x99", +}; + +static const unsigned int entry_statuses3_icase[] = { + GIT_STATUS_WT_NEW, + GIT_STATUS_WT_NEW, + GIT_STATUS_WT_DELETED, + GIT_STATUS_WT_NEW, + GIT_STATUS_WT_DELETED, + GIT_STATUS_IGNORED, + GIT_STATUS_WT_MODIFIED, + GIT_STATUS_WT_NEW, + GIT_STATUS_WT_NEW, + GIT_STATUS_INDEX_MODIFIED, + GIT_STATUS_WT_DELETED | GIT_STATUS_INDEX_MODIFIED, + GIT_STATUS_WT_MODIFIED | GIT_STATUS_INDEX_MODIFIED, + GIT_STATUS_INDEX_DELETED, + GIT_STATUS_WT_NEW | GIT_STATUS_INDEX_DELETED, + GIT_STATUS_INDEX_NEW, + GIT_STATUS_WT_DELETED | GIT_STATUS_INDEX_NEW, + GIT_STATUS_WT_MODIFIED | GIT_STATUS_INDEX_NEW, + GIT_STATUS_WT_NEW, + GIT_STATUS_WT_DELETED, + GIT_STATUS_WT_DELETED, + GIT_STATUS_WT_DELETED, + GIT_STATUS_WT_NEW, +}; + static const char *entry_paths3[] = { ".HEADER", "42-is-not-prime.sigh", diff --git a/tests-clar/status/worktree.c b/tests-clar/status/worktree.c index 05e396e1f..0ceba7f16 100644 --- a/tests-clar/status/worktree.c +++ b/tests-clar/status/worktree.c @@ -110,7 +110,13 @@ void test_status_worktree__swap_subdir_and_file(void) { status_entry_counts counts; git_repository *repo = cl_git_sandbox_init("status"); + git_index *index; git_status_options opts; + bool ignore_case; + + cl_git_pass(git_repository_index(&index, repo)); + ignore_case = index->ignore_case; + git_index_free(index); /* first alter the contents of the worktree */ cl_git_pass(p_rename("status/current_file", "status/swap")); @@ -124,8 +130,8 @@ void test_status_worktree__swap_subdir_and_file(void) /* now get status */ memset(&counts, 0x0, sizeof(status_entry_counts)); counts.expected_entry_count = entry_count3; - counts.expected_paths = entry_paths3; - counts.expected_statuses = entry_statuses3; + counts.expected_paths = ignore_case ? entry_paths3_icase : entry_paths3; + counts.expected_statuses = ignore_case ? entry_statuses3_icase : entry_statuses3; memset(&opts, 0, sizeof(opts)); opts.flags = GIT_STATUS_OPT_INCLUDE_UNTRACKED | |
