Commit 9d6c3d2853901f2fba049ba80cadb71caa8535c1

Arthur Schreiber 2014-05-30T15:15:54

Refs: Extend unicode test for branch creation. This adds another assertion to ensure that the reference name inside the git_reference struct returned by `git_branch_create` is returned as precomposed if `core.precomposeunicode` is enabled.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
diff --git a/tests/refs/branches/create.c b/tests/refs/branches/create.c
index 864640a..3a4f33b 100644
--- a/tests/refs/branches/create.c
+++ b/tests/refs/branches/create.c
@@ -179,11 +179,14 @@ void test_refs_branches_create__can_create_branch_with_unicode(void)
 		expected[0] = nfd;
 
 	for (i = 0; i < ARRAY_SIZE(names); ++i) {
+		const char *name;
 		cl_git_pass(git_branch_create(
 			&branch, repo, names[i], target, 0, NULL, NULL));
 		cl_git_pass(git_oid_cmp(
 			git_reference_target(branch), git_commit_id(target)));
 
+		cl_git_pass(git_branch_name(&name, branch));
+		cl_assert_equal_s(expected[i], name);
 		assert_branch_matches_name(expected[i], names[i]);
 		if (fs_decompose_unicode && alt[i])
 			assert_branch_matches_name(expected[i], alt[i]);