summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/config/write.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/config/write.c b/tests/config/write.c
index 56ef2e9fb..01b018b12 100644
--- a/tests/config/write.c
+++ b/tests/config/write.c
@@ -722,3 +722,26 @@ void test_config_write__repeated(void)
git_config_free(cfg);
}
+
+void test_config_write__preserve_case(void)
+{
+ const char *filename = "config-preserve-case";
+ git_config *cfg;
+ git_buf result = GIT_BUF_INIT;
+ const char *expected = "[sOMe]\n" \
+ "\tThInG = foo\n" \
+ "\tOtheR = thing\n";
+
+ cl_git_pass(git_config_open_ondisk(&cfg, filename));
+ cl_git_pass(git_config_set_string(cfg, "sOMe.ThInG", "foo"));
+ cl_git_pass(git_config_set_string(cfg, "SomE.OtheR", "thing"));
+ git_config_free(cfg);
+
+ cl_git_pass(git_config_open_ondisk(&cfg, filename));
+
+ cl_git_pass(git_futils_readbuffer(&result, filename));
+ cl_assert_equal_s(expected, result.ptr);
+ git_buf_free(&result);
+
+ git_config_free(cfg);
+}