summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinquize <linquize@yahoo.com.hk>2014-07-16 21:54:53 +0800
committerLinquize <linquize@yahoo.com.hk>2014-07-16 21:54:53 +0800
commit693748694bf3e404d09d7099527ea9f4b105f74c (patch)
tree8384528a7481a31db04288ca44c6e7509c2296c6
parent991dab2dd09baa23bd216896a273cf6c256fa7b4 (diff)
downloadlibgit2-693748694bf3e404d09d7099527ea9f4b105f74c.tar.gz
Add unit test to test add section without lf at EOF
-rw-r--r--tests/config/write.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/config/write.c b/tests/config/write.c
index 402be9317..0f11ae8da 100644
--- a/tests/config/write.c
+++ b/tests/config/write.c
@@ -229,6 +229,22 @@ void test_config_write__add_value_at_file_with_no_clrf_at_the_end(void)
git_config_free(cfg);
}
+void test_config_write__add_section_at_file_with_no_clrf_at_the_end(void)
+{
+ git_config *cfg;
+ int i;
+
+ cl_git_pass(git_config_open_ondisk(&cfg, "config17"));
+ cl_git_pass(git_config_set_int32(cfg, "diff.context", 10));
+ git_config_free(cfg);
+
+ cl_git_pass(git_config_open_ondisk(&cfg, "config17"));
+ cl_git_pass(git_config_get_int32(&i, cfg, "diff.context"));
+ cl_assert_equal_i(10, i);
+
+ git_config_free(cfg);
+}
+
void test_config_write__add_value_which_needs_quotes(void)
{
git_config *cfg;