summaryrefslogtreecommitdiff
path: root/tests-clar
diff options
context:
space:
mode:
authorPhilip Kelley <phkelley@hotmail.com>2012-09-17 15:42:41 -0400
committerPhilip Kelley <phkelley@hotmail.com>2012-09-17 15:42:41 -0400
commitec40b7f99f7f7161b0a1b24f1d8a934ec0eaacb1 (patch)
tree59744c10038258c3993a4eb1b1dfc3896c35b97a /tests-clar
parente8776d30f7edb570f435cf746d712c696b862bdd (diff)
downloadlibgit2-ec40b7f99f7f7161b0a1b24f1d8a934ec0eaacb1.tar.gz
Support for core.ignorecase
Diffstat (limited to 'tests-clar')
-rw-r--r--tests-clar/attr/lookup.c2
-rw-r--r--tests-clar/status/status_data.h50
-rw-r--r--tests-clar/status/worktree.c10
3 files changed, 59 insertions, 3 deletions
diff --git a/tests-clar/attr/lookup.c b/tests-clar/attr/lookup.c
index 40aac0b6e..200bdd2c7 100644
--- a/tests-clar/attr/lookup.c
+++ b/tests-clar/attr/lookup.c
@@ -252,7 +252,7 @@ void test_attr_lookup__from_buffer(void)
cl_git_pass(git_attr_file__new(&file, 0, NULL, NULL));
- cl_git_pass(git_attr_file__parse_buffer(NULL, "a* foo\nabc bar\n* baz", file));
+ cl_git_pass(git_attr_file__parse_buffer(NULL, NULL, "a* foo\nabc bar\n* baz", file));
cl_assert(file->rules.length == 3);
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 |